Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

  • 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?

share|improve this question

4 Answers 4

Try Display Widgets. It's what i use most of the time, and it's pretty simple to use from the Widgets settings. It might also be possible to tweak it to function as a meta box.

share|improve this answer
    
Agreed, I've used it and it is very good and quite easy to use (lots of scrolling though) but as sites grow and so do the number of custom sidebars, the widgets page gets hard to manage. Also for the user it's hard to see which widgets are on which page. I'd really like to find a solution which appears on the edit page/post screen. –  Pete Apr 13 '12 at 14:38

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

share|improve this answer

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.

share|improve this answer

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' )
) );
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.