I’m making a “blank” type template for WordPress that I’ll be able to modify for sites as I develop them. I wanted to make sure my template was compliant with the dynamic sidebars feature of WordPress and have multiple sidebars already there for quick creation with new sites. I wanted the first to have some default content, while the others would not be displayed unless they have dynamic content. I suppose that might not end up being useful for the fixedness of the one-off designs I’ve been doing, but we’ll see…
The tutorials I found didn’t discuss how to make the container for each of multiple sidebars display only if the sidebar had dynamic widgets. The is_dynamic_sidebar() function is what was needed. So I register my sidebars like normal, in “functions.php”:
if(function_exists('register_sidebar')){
register_sidebars(2, array(
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>',
));
}
Continue reading post "WordPress: Multiple Dynamic Sidebars"