This is my function:
function ec_register_sidebars() {
register_sidebars( 3,
array(
'name' => 'Sidebar %d',
'id' => "sidebar-$i",
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '',
'after_title' => ''
)
);
This does not work:
<?php if ( is_active_sidebar( 'Sidebar 1' ) ) : ?>
<?php dynamic_sidebar( 'Sidebar 1' ); ?>
<?php else : ?>
No primary sidebar content
<?php endif; ?>
BUT if I change the *is_active_sidebar* to 'Sidebar 2' or 'Sidebar 3', it works. For example, this works:
<?php if ( is_active_sidebar( 'Sidebar 2' ) ) : ?>
<?php dynamic_sidebar( 'Sidebar 1' ); ?>
<?php else : ?>
No primary sidebar content
<?php endif; ?>
I don't understand why this is. Any ideas?