Different sidebar content per page? (5 posts)

  1. auxcendres
    Posted 6 years ago #

    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!

  2. tugbucket
    Posted 6 years ago #


    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.

  3. theailona
    Posted 6 years ago #

    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. :)

  4. alanft
    Posted 6 years ago #

    another useful thing is my plugin


  5. Desislava
    Posted 5 years ago #

    @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 :)

Topic Closed

This topic has been closed to new replies.

About this Topic