WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am wondering what the standard procedure for Sidebars in WordPress. My theme needs to have 3 different types of sidebars, to be used on three different pages. I am wondering if I should create a seperate sidebar for each of these pages or use logic, to determine which form it will take? As stated earlier each sidebar will have different uses for each page template it is on.

share|improve this question
Depends on how you want/need the sidebar(s) to behave. I don't see this as answerable by anyone but you. – s_ha_dum Nov 28 '13 at 4:23
up vote 2 down vote accepted

Create separate sidebars for each page unless all of them are supposed to display the same set of widgets.

I guess you will be managing your sidebar widgets through Appearance Widgets Screen (which displays all registered widgets) so just use register_sidebar() three times or preferably register_sidebars() (set number to 3) within your functions.php file and then you're ready to put these in your template files:

<?php dynamic_sidebar( 'id-of-your-first-sidebar' ); ?>
<?php dynamic_sidebar( 'id-of-your-second-sidebar' ); ?>
<?php dynamic_sidebar( 'id-of-your-third-sidebar' ); ?>

Hope it helps. I might be wrong but I don't really see a point in creating one sidebar and using logical operators to modify them.

share|improve this answer

Your Answer


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.