[Gelöst] How to check if the gallery image in foreach loop is also the property image
This support ticket is created vor 6 Jahre, 11 Monate. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Hi, I'm creating a real estate site using your Real Estate reference site. On the single-house content template, for horribly complicated reasons, I need to display the property photo followed by all of the gallery photos, excluding the one that is the same as the property photo – basically I don't want it to display twice. Is there any way to query the gallery photos before displaying them to find out if they are the same image as the property photo? The property photo will not always be the first in the gallery list unfortunately. Below is my current output:
I am using the exact setup for images that comes with the Real Estate reference site, so the property photo is already in a separate field (property-photo), but the same image exists also in the gallery array. What I want to do is filter it out of the gallery array before displaying it in this view. Not adding it to the gallery in the first place is not an option unfortunately, for complicated reasons.