Custom Single.php pages
-
Hello,
I have a custom single.php file for all of my posts that are part of my websites business directory. Here is what the single.php file looks like, every post part of the business directory gets the “singledir.php” template:
<?php $post = $wp_query -> post; if ( in_category( array( 'insurance', 'website-design') ) ) { include(TEMPLATEPATH . '/singledir.php'); } elseif ( in_category('2') ) { include(TEMPLATEPATH . '/single2.php'); } else { include(TEMPLATEPATH . '/single1.php'); } ?>Right now I have to list every sub-category in an array. Is there any way that I can just have it grab all of the sub categories of “business-directory”, or “195”?
Thanks,
Andy
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Custom Single.php pages’ is closed to new replies.