Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Forum: Hacks
    In reply to: Different Sidebar on Pages
    Thread Starter pj.maybe

    (@pjmaybe)

    Really enjoying playing with WordPress!

    The sidebar thing however has me wondering if there is a way to have different pages show different sidebars? So if I made two different pages in WordPress one called A the other B, A would display sidebar 1 and B would display sidebar 2.

    Just wondering 🙂

    Forum: Hacks
    In reply to: Different Sidebar on Pages
    Thread Starter pj.maybe

    (@pjmaybe)

    Oh my.. how very useful! 🙂

    Thanks people.

    Forum: Hacks
    In reply to: Different Sidebar on Pages
    Thread Starter pj.maybe

    (@pjmaybe)

    OK, so I registered the following code in functions.php in my theme directory:

    // Area 7, located on all Pages. Empty by default.
    	register_sidebar( array(
    			'id' => 'page-sidebar',
    			'name' => __( 'Page Sidebar' ),
    			'description' => __( 'Sidebar for all user created pages.' ),
    			'before_widget' => '<li id="%1$s" class="widget %2$s">',
    			'after_widget' => '</li>',
    			'before_title' => '<h3 class="widget-title">',
    			'after_title' => '</h3>'
    	) );

    and called it in page.php from my theme folder thus:

    <?php get_sidebar('page-sidebar'); ?>

    The sidebar appears in admin under widgets but even if I use the area the actual page still shows the usual blog sidebar.

Viewing 3 replies - 1 through 3 (of 3 total)