• Hello, I’d like to allocate different sidebar widgets for separate pages within my site (where I’m using wordpress as a cms rather than blog) and on some pages remove the sidebar altogether. Could anyone advise me if this is possible and, if so, could you point me in the direction of how to achieve it? Many thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Yes we can do it with the help of conditional tag.

    For example you want to display sidebar “test” only in the category “test”,do this:

    <?php
    if(is_category(‘test’)){
    //sidebar test here
    }
    ?>

    Thread Starter mandarke

    (@mandarke)

    Thank you! Presumably this will work for pages as well as categories? i.e.

    <?php
    if(is_page(‘test’)){
    //sidebar test here
    }
    ?>

    Yes, you’ve got it!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sidebar for specific pages?’ is closed to new replies.