I've created my wordpress theme from the default Twenty Eleven theme, and I want to show a different sidebar on a few pages. I found this tutorial but it really doesn't answer my question.

So, I need a sidebar that is shown on admin panel at widgets page, and it should be at left side of the page.

4 Answers 4


Have a look at the Codex page for get_sidebar(). In particular, the section that mentions calling sidebars with other names and the multiple sidebar section.


You could create a page template that calls the sidebar you want like Joseph mentioned. That way you can select which template to use depending on which sidebar is right for the page.

Creating Page Templates

Adding Widget areas will show you how to widgetize the sidebar.


May not be a great, super awesome solution, but I just came across WooDojo by WooThemes. It's like Jetpack by WordPress.com plugin.

WooSidebars is a part of WooDojo plugin suite. You can download the plugin here (I think it requires WooDojo pre-installed).

What it does...

With WooSidebars you can override any widgetized area on your WordPress-powered website, displaying different widgets for different screens (a page, a category or search results, for example) without touching a line of code.

  • No theme modification required

  • Seemless WordPress Integration

  • Custom Sidebars for Any Post

  • Override any dynamic sidebar

  • Advanced Replacement Conditions (different widgets on different pages)

I am only suggesting this plugin because you can be sure that the plugin won't be abandoned like most on WP.org, and the code is not bad at all.


First add this following function to your functions.php,

function my_widgets_init() {
    register_sidebar( array(
        'name'      => __( 'Custom Sidebar Widgets' ),
        'id'        => 'custom-sidebar-widgets',
        'before_widget' => '<div id="%1$s" class="widget sidebar-widget custom-sidebar-widgets %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h3 class="widgettitle">',
        'after_title'   => '</h3>',
    ) );
add_action( 'widgets_init', 'my_widgets_init', 11 );

Add this code where you want to fetch custom sidebar,

<!-- begin custom sidebar -->
<div id="custom-sidebar">
    if ( function_exists( 'dynamic_sidebar' ) && dynamic_sidebar( 'custom-sidebar-widgets' ) ) {
        /* Custom code if dynamic_sidebar not found */
    } ?>
<!-- end sidebar2 -->

This code works fine to me.

  • 1
    function_exists( 'dynamic_sidebar' ) is not necessary.
    – fuxia
    Commented Oct 25, 2013 at 10:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.