Querying Single.php Pages? Query/Design Problems.
-
Hello,
I’m trying to achieve a seperate Single page for 3 categories (Graphic Design, Website Design & Blog), I managed to track down the code I need and arranged the files as required. However for some reason I’m have two problems.
One: When I use the code bellow in the single.php file to query two Single Pages it messes up the CSS of the single page it leads you to i.e. https://dev.mrleesimpson.co.uk/2008/04/test-post-image/
<?php $post = $wp_query->post; if ( in_category('3') ) { include(TEMPLATEPATH . '/single_graphic.php'); } else { include(TEMPLATEPATH . '/single_blog.php'); } ?>
Two: When I try to use the code bellow in the single.php file, to query 3 different Single Pages it won’t work at all.
<?php $post = $wp_query- >post; if ( in_category('4') ) { include(TEMPLATEPATH . '/single_website.php'); } elseif ( in_category('3') ) { include(TEMPLATEPATH . '/single_design.php'); } else { include(TEMPLATEPATH . '/single_blog.php'); } ? >
So it’ll query 2 but it messes up the page layout and it just won’t query 3 at all.
Has anyone got any ideas?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Querying Single.php Pages? Query/Design Problems.’ is closed to new replies.