Remove link from featured image in a specific category
-
Hi,
I have an archive page for a specific category and I would like to remove the link on the featured image (I wish to keep the featured image). I came across this code which I think removes the link from ALL featured images:
<?php if ( has_post_thumbnail()) : ?> //remove opening a tag <?php the_post_thumbnail(); ?> //remove closing a tag <?php endif; ?>
I think I just need to adapt this so that the if statement checks which category before removing it. My category ID is 4167, so do I insert something like this in my functions file?
if ( in_category( '4167' ) ) { if ( has_post_thumbnail()) : ?> //remove opening a tag <?php the_post_thumbnail(); ?> //remove closing a tag <?php endif; ?> }
I am not great at php so I am unsure if this is correct.
Any pointers appreciated, thanks.
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Remove link from featured image in a specific category’ is closed to new replies.