Lightbox shows images from front page instead of current project page
-
Hi,
I’m seeing a lightbox issue on a project page I’m working on.
When I click an image here:
https://dev.nataschalibbert.nl/work/undermined/
…the lightbox does not show images from that project page. Instead, it opens/shows images from a normal page, specifically the News page, which is set as the front page.
Does anybody know how this is possible and how to fix it?
Thanks.
-
Extra debugging info:
The issue seems related to the Lightbox Addon collecting images that are present in the DOM but not part of the current project content.
On a direct load of a project page:
- the body tag is correct and shows data-type="project" and the correct project data-id
- the visible project images are correct
- the clicked project image has the correct data-id, for example data-id="97"
- however, the opened lightbox image has a different data-id, for example data-id="1081", and belongs to the static front page/news page
I searched the DOM and found that the wrong frontpage/news images are present inside the project page DOM, although they are not visible on the page.
They appear inside rows with classes like:
absolute-positioning-vertically-in-apl
The image column has attributes like:
data-type="img"
data-yvel="1"The lightbox then opens a Swiper gallery with the frontpage/news images, for example 1 / 12.
Important detail:
If I temporarily disable the static front page in Settings → Reading, direct project page loads open the correct project images in the lightbox. When I set /news as the static front page again, the issue returns.So it looks like the Lightbox Addon may be collecting hidden APL/frontpage images from the DOM on direct project page load, instead of only collecting images from the current project content.
This happens even though the frontpage/news page itself does not have Lightbox enabled.
For 1on1 paid Lay Theme Coaching, contact: audrey@cyberslayers.work.
We also code custom websites or custom Lay features.
💿 Email us here: 💿
info@laytheme.com
Our Web Development company: 100k.studio
Want to tip me? https://www.paypal.com/paypalme/arminunruh
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it