{"id":39776,"date":"2026-09-15T09:48:15","date_gmt":"2026-09-15T07:48:15","guid":{"rendered":"https:\/\/mainetcare.de\/?post_type=gartenschuppen&#038;p=39776"},"modified":"2026-09-15T12:57:42","modified_gmt":"2026-09-15T10:57:42","slug":"why-doesnt-the-lightbox-work-on-the-front-end-of-my-wordpress-site-in-firefox-browsers","status":"publish","type":"gartenschuppen","link":"https:\/\/mainetcare.de\/en\/gartenschuppen\/warum-funktioniert-bei-meinem-wordpress-im-frontend-die-lightbox-nicht-auf-firefox-browsern\/","title":{"rendered":"Why isn't the lightbox working on the front end of my WordPress site (in Firefox browsers)?"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Are you working with Gutenberg blocks, have you added a lightbox to an image or gallery block, and now it's not working on the front end? The magnifying glass icon appears, but clicking it doesn't bring up the enlarged view?<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"973\" src=\"https:\/\/mainetcare.de\/wp-content\/uploads\/2026\/09\/grafik-1-1024x973.png\" alt=\"\" class=\"wp-image-39778\" srcset=\"https:\/\/mainetcare.de\/wp-content\/uploads\/2026\/09\/grafik-1-1024x973.png 1024w, https:\/\/mainetcare.de\/wp-content\/uploads\/2026\/09\/grafik-1-400x380.png 400w, https:\/\/mainetcare.de\/wp-content\/uploads\/2026\/09\/grafik-1-768x729.png 768w, https:\/\/mainetcare.de\/wp-content\/uploads\/2026\/09\/grafik-1.png 1036w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Problem<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This may be because you need to check the order in which scripts are loaded in your theme. In our case, the problem with a client's website was the way the Photoswipe script was loaded. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The custom JavaScript was inserted into the page too early. As a result, Firefox ignored the WordPress address list. Without that list, the gallery lightbox could no longer find its components.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Workaround<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After setting the priority to 30 (Low), the lightbox worked in the WordPress front end:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">add_action('wp_footer', 'YOUR-SCRIPT-HANDLE', 30);<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">An even better solution starting with WordPress 6.5<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Starting with WordPress 6.5, scripts can also be managed through WordPress's built-in administration interface. So instead of outputting your own module manually, register it using the Scripts Module API. See also <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>","protected":false},"featured_media":39778,"template":"","meta":{"_acf_changed":false},"class_list":["post-39776","gartenschuppen","type-gartenschuppen","status-publish","has-post-thumbnail","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/mainetcare.de\/en\/wp-json\/wp\/v2\/gartenschuppen\/39776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mainetcare.de\/en\/wp-json\/wp\/v2\/gartenschuppen"}],"about":[{"href":"https:\/\/mainetcare.de\/en\/wp-json\/wp\/v2\/types\/gartenschuppen"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mainetcare.de\/en\/wp-json\/wp\/v2\/media\/39778"}],"wp:attachment":[{"href":"https:\/\/mainetcare.de\/en\/wp-json\/wp\/v2\/media?parent=39776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}