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 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
add comment

1 Answer

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
add comment

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.