WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Broken Dynamic Sidebar (4 posts)

  1. aptdesignonline
    Member
    Posted 6 years ago #

    Hi,

    I am trying to add three widgetized sidebar divs. The code looks like this:

    <div id="sidebar">
    
        <div id="l_sidebar">
        <ul>
        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?>
        <?php endif; ?>
        </ul>
        </div>
    
        <div id="m_sidebar">
        <ul>
        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>
        <?php endif; ?>
        </ul>
        </div>
    
        <div id="r_sidebar">
        <ul>
        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(3) ) : ?>
        <?php endif; ?>
        </ul>
        </div>
    
    </div>

    As you can see these are all setup the exact same way, but when in WP I only get options for Sidebar 1 and 2. If I change the '2' and '3' in the code, Sidebar 2 will show up in div#r_sidebar.

    I am totally stumped, anyone have any ideas? Is there another setting somewhere else that is limiting the number of sidebars I can use?

    Thanks in advance.

  2. ladycrow
    Member
    Posted 6 years ago #

    Have you created your functions.php in the theme folder? If not, you'll need to

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebars(3);
    ?>

    That should work

  3. aptdesignonline
    Member
    Posted 6 years ago #

    Oh Ladycrow. I weep for happiness over the help you have provided. Thank you so much.

  4. aptdesignonline
    Member
    Posted 5 years ago #

    Ladycrow,

    Thanks again for your help with this.

    Soon after I implemented this in my Sandbox theme would no longer load when I added www. to the beginning of my URL. I finally traced it back to this code.

    Not sure why that happened at all, but if you are using the Sandbox theme and want to change the number of sidebars, you can change this code on line 437

    // Table for how many? Two? This way, please.
    	register_sidebars( 3, $p );

    Hopefully that will help someone, sometime.

Topic Closed

This topic has been closed to new replies.

About this Topic