Forums

Multiple Sidebars issue (4 posts)

  1. estevancarlos
    Member
    Posted 4 months ago #

    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.
    What's the issue?

    Thanks

  2. estevancarlos
    Member
    Posted 4 months ago #

    I just noticed that if I have this:

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

    "Sidebar 1" will display when set up this way. How come?

  3. estevancarlos
    Member
    Posted 4 months ago #

    Any hints? I've posted this on Sitepoint, StackExchange and here and no one has commented. It's become rather mysterious now. Is the Sidebar thing in WordPress buggy?

  4. estevancarlos
    Member
    Posted 4 months ago #

    None of the sidebars are working at the moment. Not sure why:
    http://estevancarlos.kodingen.com/ecv7/?projects=rada-2

Reply

You must log in to post.

About this Topic