i am wondering how i go about making a Template for some of my pages to use a different sidebar? I have created the widget like this:

    'id' => 'ourPat-sidebar',
    'name' => 'ourPat Sidebar',
    'before_widget' => '<div class="widget %2$s" id="%1$s">',
    'after_widget' => '</div>',
    'before_title' => '<h3>',
    'after_title' => '</h3>'

In side my Functions.php code.

Then i go into my Widget panel and its displayed just fine. Then i proceed to add text to it in order to form the sidebar html.

widget menu

However, when i go to my Page menu and create a new page, i do not have the choice to use the custom widget code?


So i must be doing something incorrect since its not in there.

To recap, i'm just looking for a way for different pages of mine to use a different sidebar using a custom widget i made.

1 Answer 1


In order to accomplish this you will need to also create a separate page template to use. You may need to double check your template head information.


  * Template Name: Your Template name

This has to be put at the top of the page template. Then within the custom page template you will need to call the custom sidebar that you have.

You will need to put this in the template where you want your sidebar to go:

if ! dynamic_sidebar( 'ourPat Sidebar' ) ) :
    You need to add widgets for items to show in this area. To add for this area add widgets to "ourPat Sidebar".
  • No problem. Glad to have been able to help. :)
    – Nicole
    Nov 27, 2012 at 21:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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