Title: Bug?
Last modified: April 25, 2023

---

# Bug?

 *  Resolved [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [3 years ago](https://wordpress.org/support/topic/bug-402/)
 * Hello, I discovered that lightbox does not work when page has parent, i.e. when
   it is a child page. I am currently attempting to debug that. Any hints?
   I use
   block editor gallery block, but it does not work for single images as well.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fbug-402%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [3 years ago](https://wordpress.org/support/topic/bug-402/#post-16687630)
 * The page you mentioned does not use Lightbox with PhotoSwipe. This a gallery 
   plugin or theme which provides its own implementation of Photoswipe 4 with some
   modifications like a custom transition slider. Please ask the maintainers of 
   that plugin or theme for assistance.
 * Easy check: if you can not go to full screen by pressing the F key on the keyboard
   in the opened lightbox, then it is not my plugin (because this is a feature I
   added to it).
 * For completeness: no child pages are not a problem, as my plugin works as content
   filter which works regardless if it is a post, parent page or child page. Also
   technically child pages are not different to parent pages. They only have the
   ID of the parent page added as property in the database.
 * For working example of a child page with images opening in Lightbox with Photoswipe
   see here: [https://arnowelzel.de/en/projects/periodical](https://arnowelzel.de/en/projects/periodical)
    -  This reply was modified 3 years ago by [Arno Welzel](https://wordpress.org/support/users/awelzel/).
    -  This reply was modified 3 years ago by [Arno Welzel](https://wordpress.org/support/users/awelzel/).
 *  Thread Starter [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [3 years ago](https://wordpress.org/support/topic/bug-402/#post-16687718)
 * Yes, sorry for the confusion. In the meantime, I removed lightbox with photoswipe,
   since it is a live production page and put meow lightbox which works. I debuged
   a little more and discovered the real cause. I also use “mutltiple domain mapping”
   plugin to achieve two domains on the same wordpress instalation, domain is different
   for part of the pages. The one I reported is one of the two which is remapped,
   the other one being native. The plugin does not work in specific combination,
   when second (remapped) remapped domain is used and when page has parent page.
   Otherwise it works. However, since this is a very special, non-standard use-case,
   I cannot expect of you to fix such cases. Thank you for taking a look at the 
   problem.
 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [3 years ago](https://wordpress.org/support/topic/bug-402/#post-16687789)
 * Thank you for the feedback and additional information.
 * Yes, the domain name is important to determine if an image is a local image or
   not. But the images should still work, as the domain is only relevant to get 
   caption data from the WordPress database.
 * Anyway, since I now know the plugins involved I can have a look into it – even
   if this is a rare non-standard use case it should either work or at least be 
   documented if it does not work, so others will know about that.
 *  Thread Starter [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [3 years ago](https://wordpress.org/support/topic/bug-402/#post-16687882)
 * Ok. I also made one mistake in reporting which I discovered just now. Functioning
   of plugin has nothing to do with if page is child page or not. I just implemented
   a system when page is a child page of specific page then it is remapped to other
   domain, and when it isn’t than it is not. So, in conclusion, plugin does not 
   work when [https://wordpress.org/plugins/multiple-domain-mapping-on-single-site/](https://wordpress.org/plugins/multiple-domain-mapping-on-single-site/)
   is used and when remapped domain is used. It is very probably as you said, since
   domain is diferent, the whole process of adding data-lwps-* attributes in `callbackProperties`
   in `LigtboxPhotoSwipe.php` does not work
 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [3 years ago](https://wordpress.org/support/topic/bug-402/#post-16688318)
 * I just did a quick test:
    1. Images served this way will be identified as “external” images, but still work
       as expected.
    2. The second domain name must be known on the host serving the website. If this
       is not the case, then the plugin can not load the jpeg headers – because this
       will be done with an HTTP request if the image is considered “external”. However
       if the server itself does not know the domain, the request will fail and the
       plugin can not add the required meta data for the frontend script.
 * However, there is a workaround which should work for you:
 * In the backend settings of Lightbox with Photoswipe, go to “General” and add 
   the second domain as following:
    - Put the second domain in the “CDN URL prefix” – e.g. as `http://yourdomain.
      example/` without anything else.
    - Set the “CDN mode” mode to “Pull”.
 * This will make sure, that if images are served using the second domain, Lightbox
   with Photoswipe will first replace the domain as stated in the “CDN URL prefix”
   with the regular site domain before doing anything else with the image. As a 
   result the image should work without any issues.
 * If you have multiple domain mappings, you can add them separated by comma like`
   http://alternative-one.example,http://alternative-two.example`. And don’t forget
   to use “Pull” for the CDN mode.
    -  This reply was modified 3 years ago by [Arno Welzel](https://wordpress.org/support/users/awelzel/).
    -  This reply was modified 3 years ago by [Arno Welzel](https://wordpress.org/support/users/awelzel/).
 *  Thread Starter [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [3 years ago](https://wordpress.org/support/topic/bug-402/#post-16688330)
 * All clear except “The second domain name must be known on the host serving the
   website” – what do you mean by that?
 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [3 years ago](https://wordpress.org/support/topic/bug-402/#post-16688335)
 * With “The second domain name must be known on the host serving the website” I
   mean the the server itself must be able to resolve the domain name to an IP address
   and it must be possible to do HTTP requests to that address on the host itself.
 * This is sometimes a problem if the webserver does not accept HTTP requests from
   localhost or if the webserver is behind a proxy and expects requests addressing
   localhost and not the real IP address. If in doubt ask the service provider or
   an administrator about this.
 * But the workaround should also fix this without any change on the webserver at
   all.
    -  This reply was modified 3 years ago by [Arno Welzel](https://wordpress.org/support/users/awelzel/).
 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [3 years ago](https://wordpress.org/support/topic/bug-402/#post-16688344)
 * Oh – and also think about using `https://` instead of `http://` if your site 
   is served via HTTPS.
 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [3 years ago](https://wordpress.org/support/topic/bug-402/#post-16688813)
 * I just published version 5.0.31 which includes active support for [https://wordpress.org/plugins/multiple-domain-mapping-on-single-site/](https://wordpress.org/plugins/multiple-domain-mapping-on-single-site/)(
   which can be disabled in the backend settings if there is any issue with that)–
   so the workaround is no longer needed.
 * Technically my plugin will check, if that plugin is active and if yes, it will
   read the domain mappings from that plugin and use them to handle images correctly
   on mapped domains as well.
 * You may give it a try – if it works, let me know – thanks.
 *  Thread Starter [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [3 years ago](https://wordpress.org/support/topic/bug-402/#post-16688821)
 * Wow! Thanks so much!
 *  Thread Starter [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [3 years ago](https://wordpress.org/support/topic/bug-402/#post-16688868)
 * I tested on my local instalation, and it works! After I make sure everything 
   is ok, I will put it on live site as well.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Bug?’ is closed to new replies.

 * ![](https://ps.w.org/lightbox-photoswipe/assets/icon-256x256.png?rev=2906302)
 * [Lightbox with PhotoSwipe](https://wordpress.org/plugins/lightbox-photoswipe/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lightbox-photoswipe/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lightbox-photoswipe/)
 * [Active Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lightbox-photoswipe/reviews/)

## Tags

 * [page](https://wordpress.org/support/topic-tag/page/)
 * [parent](https://wordpress.org/support/topic-tag/parent/)

 * 11 replies
 * 2 participants
 * Last reply from: [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/bug-402/#post-16688868)
 * Status: resolved