Forums

[resolved] How to tell WordPress category page to call specific sidebar (2 posts)

  1. WMS Group
    Member
    Posted 2 years ago #

    I am trying to pull in a styled sidebar specific to the category. I have the following code which works, but it is pulling in BOTH my new sidebar and the default. What am I doing wrong here?

    From category.php

    <?php get_sidebar();
    if ( in_category('39') ) {
    include(TEMPLATEPATH . '/sidebar2.php');
    
    } else {
    include(TEMPLATEPATH . '/sidebar.php');
    
    }
    ?>
    <?php get_footer(); ?>
  2. WMS Group
    Member
    Posted 2 years ago #

    I got it! I had to delete the <?php get_sidebar(); since THAT was the line calling in the default sidebar as well. I was telling it to load twice. Silly me :)

Topic Closed

This topic has been closed to new replies.

About this Topic