Forums

Creating a dynamic sidebar this way? (3 posts)

  1. AntonioP
    Member
    Posted 3 years ago #

    I need to create a few sidebars that will display depending on what is being displayed (page, post, category, etc.) I'm wondering how this can be accomplished.

    if its a single post do this
    <?php get_sidebar('singlepost.php'); ?>

    if its the services page do this
    <?php get_sidebar('services.php'); ?>

    if its the media page do this
    <?php get_sidebar('media.php'); ?>

    etc...etc...

  2. Evita
    Member
    Posted 3 years ago #

    WordPress Codex is your friend.

  3. alanft
    Member
    Posted 3 years ago #

    you can either define multiple sidebars in your theme (there are loads of 'how toss' for that you can google) or you could use my plugin that makes individual widgets conditional/context sensitive

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

Topic Closed

This topic has been closed to new replies.

About this Topic