Multiple single.php pages

Community Forums Forums General Discussion Multiple single.php pages

This topic is: not resolved


This topic contains 2 replies, has 2 voices, and was last updated by  Summer 2 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #65326


    Creating a category blog page is very useful, but it means that the same single.php file is used when viewing a single post.

    I would like to have multiple single.php templates available so I can show different sidebars depending on the category blog post being shown.

    I know how to achieve this outside of Genesis, for example:

    $post = $wp_query->post;
    if (in_category('9'))  {
    include(TEMPLATEPATH . '/single1.php');
    elseif ( in_category('8') ){
    include(TEMPLATEPATH . '/single2.php');
    else {
    include(TEMPLATEPATH . '/single3.php');

    but wanted to ask if there is a built in method for making this work inside Genesis?

    Thanks in advance for any tips with this.







    Actually, you would want to use a category template, not a single template. That way you have one template for each category you want to customize, and it works for Genesis and non-Genesis themes, and you’d have a category-8.php, or category-car-news.php, etc.

    But if you want more granularity of control over your sidebars, you might be better off with a plugin that manages which widgets appear on which posts/pages.

    I like Dynamic Widgets, and use it on a number of sites to put different AdSense ads or special category listings only on certain pages.

    WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
    Slice of SciFi | Writers, After Dark

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.