Archived topic
Don't load a featured images if hidden
3 replies · Started by Matic on March 2, 2022
Hi,
My blog posts have enabled featured images. However, in some posts I disable the featured images from the Editor by going to Layout > Disable Elements > Check Featured Image.
But in these posts the featured images load all the same--they're just hidden {display: none}.
Is there are a way to deque (not load) the featured image in these kind of posts other than creating a custom post?
I noticed that the image is loaded by do_action('generate_after_entry_title'); in the content-single.php. Do you think that I could write a php IF expr that would only load featured images that don't have them "hidden"? I don't know what to use as condition.
Hi Matic,
I thought we fixed this already but apparently not.
Can you try using a Layout element with display rules instead?
https://docs.generatepress.com/article/layout-element-overview/
That should remove the entire HTML.
Let me know :)
This indeed helped.
Thank you!
No problem :)