"If Category Then" on Single Post Page
-
I’d like the following code to execute on the single.php page:
<div> <?php if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail())) : ?> <?php the_post_thumbnail('full') ?> <?php endif ?> </div>
But only if in category 6. I’ve tried the following but get PHP errors:
<?php if(is_category('6')){ echo '<div>'; if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail())) : the_post_thumbnail('full') endif } echo '</div>'; } ?>
Any insight is appreciated!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘"If Category Then" on Single Post Page’ is closed to new replies.