Custom Category Template
-
I am trying to display posts by groups with each group/category having it’s own header image and template. In my index.php file for my master template, I have the following:
<?php if (is_home()) { include (TEMPLATEPATH . "<?php echo get_settings('home'); ?>/wp-content/themes/simpla/postlisting_home.php"); } else if (is_category('3')) { include (TEMPLATEPATH . "<?php echo get_settings('home'); ?>/wp-content/themes/simpla/postlisting_news.php"); } else if (is_category('4')) { include (TEMPLATEPATH . "<?php echo get_settings('home'); ?>/wp-content/themes/simpla/postlisting_media.php"); } else { include (TEMPLATEPATH . "<?php echo get_settings('home'); ?>/wp-content/themes/simpla/postlisting_misc.php"); } ?>
Basically I am trying to get it so that if it is home, it uses a specfic template. If the page has posts for category 3, use the specified template, etc. However the above codes displays nothing. (All four template files exist and are correct.) I don’t receive any error message at all.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom Category Template’ is closed to new replies.