is_category OR in_category condition
I’m trying to make a condition that creates sidebar content if a specific category archive is being viewed OR if a post in that category is being viewed.
I was thinking this would work but it’s not:
$post = $wp_query->post;
if ( in_category(19) || is_category(19) ) : ?>
DO SOME STUFF
<?php endif; ?>
- The topic ‘is_category OR in_category condition’ is closed to new replies.