How to show different widgets on different pages in a user friendly way

I’m looking for a plugin to let users choose which widgets appear on individual pages.

There’s some solutions out there, none of which that I’ve found are truly easy for a non-technical user. I’ve tried

Read More
  • Woo Themes Sidebar manager – Great
    functionality, but a user would need a lot of training to understand
    templates, sidebars and widgets – quite confusing.
  • Plugins like Widget context and Widget logic, both of
    which, in my opinion are difficult for an average user.

I have seen a good-looking solution which uses the Genesis Framework (simple sidebars) – this has the right approach. The user can choose the widget from within the page editor. To me, that’s the important point.

So, does anyone know any plugins (not using Genesis) which allow the same in-page choosing of sidebars?

Related posts

Leave a Reply

4 comments

  1. You can create your own sidebar if you want.

    add the following to your functions.php

     register_sidebar(array('name'=>'Sidebar ',
        'before_widget' => '<div class="widget">',
        'after_widget' => '</div>',
        'before_title' => '<p>',
        'after_title' => '</p>',
    ));
    

    and you can use this widget by using the following code

    <?php dynamic_sidebar('sidebar')?>
    

    Hope this helps

  2. I use Widget Context to achieve this. It’s quite flexible, covers almost every logic you would need to display/hide a widget and in case it’s not there lets you create custom rules like a specific url where you would like to display / hide your widget.

    Not to mention it’s been around for a long time and is well maintained.

  3. You can use code to control where your widget displays by adding a conditional tag to the code which calls your sidebar in your template file:

    <?php if ( is_page('007') && is_active_sidebar( 'your-sidebar' ) ) : ?>
    <div class="your-sidebar">
    <?php dynamic_sidebar( 'your-sidebar' ); ?>
    </div>
    <?php endif; ?>
    

    Another way to call your widget is to use code like this directly in a template file or from your functions file:

    add_action( 'loop_start', 'conditional_sidebar' );
    
    function conditional_sidebar() {
    
    if ( is_page('007') && is_active_sidebar( 'your-sidebar' ) ) {
    
    dynamic_sidebar( 'your-sidebar', array(
    'before' => '<div class="your-sidebar widget-area">',
    'after'  => '</div>',
    ) );
    
        }
    }
    

    Note: This code will only work if you have also registered a sidebar in your functions file.

    register_sidebar( array(
    'name'         => __( 'Your Sidebar' ),
    'id'           => 'your-sidebar',
    'description'  => __( 'Only displays on page with I.D 007' )
    ) );