Multiple Sidebars issue

I’m using register_sidebars to create multiple sidebars:

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' => ''
	)
);

And this is in the theme:

<?php if ( is_active_sidebar( 'Sidebar 1' ) ) : ?>
<?php dynamic_sidebar( 'Sidebar 1' ); ?>
	<?php else : ?>
	No primary sidebar content
<?php endif; ?>

Three sidebars appear within the WP admin. I am able to place widgets in all three. However nothing ever shows up in the theme when I load “Sidebar 1” but “Sidebar 2” and “Sidebar 3” work fine.

BUT I just noticed that if I check to see if Sidebar 2 or 3 are active, THEN I can display Sidebar 1:

<?php if ( is_active_sidebar( 'Sidebar 2' ) ) : ?>
<?php dynamic_sidebar( 'Sidebar 1' ); ?>
	<?php else : ?>
	No primary sidebar content
<?php endif; ?>

What’s going on with this?

Any suggestions? If not can anyone tell me if there are common issues with Sidebars or even bugginess?

could you provide some detail as to what is required? preferably via a live link or some screenshot explaining what is happening with your current code and what should actually come up

[QUOTE=jaagare;5036354]could you provide some detail as to what is required? preferably via a live link or some screenshot explaining what is happening with your current code and what should actually come up[/QUOTE

Here are the sidebars in the admin: As you can see, Sidebar 1 has nothing showing even though I have saved a widget there several times. You can view a page here: http://estevancarlos.kodingen.com/ecv7/?projects=rada-2

Also, I’m not sure what happened but none of the sidebars are working now. Here’s the code for the sidebars from their respective sidebar template files:

<div id="sidebar-primary" class="sidebar">

	<?php if ( is_active_sidebar( 3 ) ) : ?>

		<?php dynamic_sidebar( 'sidebar-3' ); ?>

	<?php else : ?>

		<!-- Create some custom HTML or call the_widget().  It's up to you. -->
		No primary sidebar content

	<?php endif; ?>
</div>
<div id="sidebar-article">

	<?php if ( is_active_sidebar( 2 ) ) : ?>
		<?php dynamic_sidebar( 'sidebar-2' ); ?>
		<?php the_tags(); ?><br />

	<?php else : ?>

		<!-- Create some custom HTML or call the_widget().  It's up to you. -->
		No primary sidebar content

	<?php endif; ?>
</div>
<div id="sidebar-primary">
	<?php if ( is_active_sidebar( 2 ) ) : ?>

		<?php dynamic_sidebar( 'sidebar-1' ); ?>

	<?php else : ?>

		<!-- Create some custom HTML or call the_widget().  It's up to you. -->
		No primary sidebar content

	<?php endif; ?>

</div>

Apologies for the horrible formatting in the previous post.

You can view my code here (consolidated into one text file. It’s not much): http://estevancarlos.kodingen.com/ecv7/ec_code.txt
and the URL again: http://estevancarlos.kodingen.com/ecv7/?projects=rada-2

Ok finally a solution.
here is how i went about it

first in functions.php added this code

if ( function_exists(‘register_sidebar’) )
{
register_sidebars( 3, $args );
$args = array(
‘name’ => sprintf(__(‘Sidebar %d’), $i ),
‘id’ => ‘sidebar-$i’,
‘before_widget’ => ‘’,
‘after_widget’ => ‘’,
‘before_title’ => ‘’,
‘after_title’ => ‘’ );

}

this is the standard wordpress code to create multiple sidebars and will create Sidebar 1, Sidebar 2 and Sidebar 3

Then where ever we want to show the sidebar

add this

<?php if ( dynamic_sidebar( ‘Sidebar 1’ ) ) {} else { echo ‘No primary sidebar content 1’; } ?>
<?php if ( dynamic_sidebar( ‘Sidebar 2’ ) ) {} else { echo ‘No primary sidebar content 2’; } ?>
<?php if ( dynamic_sidebar( ‘Sidebar 3’ ) ) {} else { echo ‘No primary sidebar content 3’; } ?>

hope this helps you

For multiple sidebars, this is the code I use in functions.php:

function register_theme_sidebars(){
    if( function_exists('register_sidebar') ){
        register_sidebar(array(
            'id' => 'sidebar-1',
            'name' => 'Sidebar 1',
            'description' => 'Description for sidebar location - will appear in wp-admin area.',
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '',
            'after_title' => ''
            ));
        register_sidebar(array(
            'id' => 'sidebar-2',
            'name' => 'Sidebar 2',
            'description' => 'Description for sidebar location - will appear in wp-admin area.',
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '',
            'after_title' => ''
            ));
        register_sidebar(array(
            'id' => 'sidebar-3',
            'name' => 'Sidebar 3',
            'description' => 'Description for sidebar location - will appear in wp-admin area.',
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '',
            'after_title' => ''
            ));
    }
}
add_action('widgets_init', 'register_theme_sidebars');

The way you did it is good. But this way you can change the settings for each sidebar - like title, description, etc.

You can also simplify the way you display the sidebar in theme like this:

<? if( !dynamic_sidebar('sidebar-1') ): ?>
    Sidebar 1 doesn't have any widgets. 
<? endif; ?>

This way you don’t have to put the empty {} brackets.