Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other How to make PHP "if" code to display:none if a featured image is not set Reply To: How to make PHP "if" code to display:none if a featured image is not set

#253158
Atelierbram
Participant

Would it be possible for you to edit the single.php file, or the one with the .featured-images-in-posts div, and wrap that div within a conditional tag (checking if the thumbnail is set), something like:

<?php if(has_post_thumbnail()): ?><?php endif; ?> 

Where the featured-image-in-posts div will be before the endif (can’t format this over here, sorry)