Support » Plugins » Different sidebar content per page?

  • auxcendres


    i’m trying to figure out how to have different content in the sidebar on each page. for example, i’m an artist so on the page that shows my work i’d like to have different categories in the sidebar. or on my about page i’d like to have resume, bio and artist’s statement categories in the sidebar.

    is this possible and can anyone help me figure out how to do it? thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • tugbucket



    Lest say you have these categories and these are their category numbers:

    resume (cat 1)
    bio (cat 2)
    artist’s statement (cat 3)
    oils (cat 4)
    acryllics (cat 5)
    mixed media (cat 6)
    fun stuff (cat 7)
    exhibits (cat 8)

    In your side bar you can do something like so:

    <?php if ( is_page('about')) { ?>
       <?php wp_list_cats('exclude=4, 5, 6, 7, 8'); ?>
    <?php } elseif ( is_page('gallery')) { ?>
       <?php wp_list_cats('exclude=1, 2, 3, 7, 8'); ?>
    <?php } else {  ?>
       <?php wp_list_cats('exclude=1, 2, 3, 4, 5, 6'); ?>
    <?php }	 ?>

    there might be an easier way but this should work.



    You can either include different sidebar.php files, like the one mentioned in Cutomizing Your Sidebar or follow this short tutorial namely Multiple Sidebar Content in WordPress. 🙂



    another useful thing is my plugin

    @alanft – just tried it on my installation based on WordPress mu – worked like charm. Thanks a lot for your effort – you just brightened up my day 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Different sidebar content per page?’ is closed to new replies.