Wp queries for single.php template
-
Hey guys,
I am using the following code for the single post:
<?php $post = $wp_query->post; if (in_category('portfolio')) { include(TEMPLATEPATH.'/single_portfolio.php'); } elseif (in_category('news')) { include(TEMPLATEPATH.'/single_news.php'); } elseif(has_tag('review') && in_category('news')){ include(TEMPLATEPATH.'/single_review.php'); } else{ include(TEMPLATEPATH.'/single_default.php'); } ?>
However, for the single_review I am checking if it’s inside category news and has tag “review”, but it’s not working. Any suggestions? Thank you.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Wp queries for single.php template’ is closed to new replies.