Word Press side bar.

I work on a Word Press web site and I want to put thin formation in a widget on only one page. I want to put other information on the other page’s side bars. I did locate a forum that gave some information but I do not know how to implement it.

It said:
Ok, add this to your theme’s functions.php:
register_sidebar( array (
‘name’ => ‘Sidebar 2’,
‘id’ => ‘sidebar-2’,
‘before_widget’ => ‘

  • ’,
    ‘after_widget’ => “
  • ”,
    ‘before_title’ => ‘

    ’,
    ‘after_title’ => ‘

    ’,
    ) );
    Then find the place in your page.php where it says something like this: <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>

    and replace it with this:

    <?php if ( is_page(your_page_name) ) { get_sidebar( 'sidebar-2' ); } else { get_sidebar(); } ?>

    Thank you if you can help.

    There are several plugins that will do this for you. One such is Widget Context another more complex one is Widget Logic. Both allow you to select on which page a widget will be displayed.

    I use the plugin Custom Widgets. You can select where you want widgets to appear. And you don’t need to fool with your theme’s code. :stuck_out_tongue:

    Hope that helps!

    Sponsor our Newsletter | Privacy Policy | Terms of Service