Support » Plugins » Different sidebar content per page?

  • auxcendres

    (@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

    (@tugbucket)

    Conditional_Tag

    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')) { ?>
       <ul>
       <?php wp_list_cats('exclude=4, 5, 6, 7, 8'); ?>
       </ul>
    <?php } elseif ( is_page('gallery')) { ?>
       <ul>
       <?php wp_list_cats('exclude=1, 2, 3, 7, 8'); ?>
       </ul>
    <?php } else {  ?>
       <ul>
       <?php wp_list_cats('exclude=1, 2, 3, 4, 5, 6'); ?>
       </ul>
    <?php }	 ?>

    there might be an easier way but this should work.

    theailona

    (@theailona)

    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. 🙂

    alanft

    (@alanft)

    another useful thing is my plugin

    http://wordpress.org/extend/plugins/widget-logic/

    @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.