Different post categories as different pages
-
Hello All,
I’ve searched high and low, but can’t seem to find an answer..
I need to keep posts categorized as ‘News’ separate from posts categorized as ‘Blog’ as well as be able to style the single page templates and archive pages for each differently.
I have successfully created the two pages (‘News’ and ‘Blog’) that display the correct category content and if you click on either a ‘News’ OR ‘Blog’ post I am using the following code to send them to the correct single page template:
<?php if ( in_category('10') ) { include(TEMPLATEPATH . '/single_blog.php'); } else { include(TEMPLATEPATH . '/single_news.php'); } ?>HOWEVER, if I click on ‘News’, even though it is going to the correct single page template, the body tag still displays:
<body class="blog">which doesn’t allow me to style it as being in the ‘News’ section. If I click on a post in either category the body tag displays<body class="single">which doesn’t allow me to style posts as either ‘News’ or ‘Blog’.How can I add the category to the body tag? OR is there a better way to do this?
Thanks!
The topic ‘Different post categories as different pages’ is closed to new replies.