• Resolved semidivine

    (@semidivine)


    What am I doing wrong?

    I have this code in my functions.php:

    if ( function_exists('register_sidebar') )
    {
    register_sidebar(array('name'=>'twitter'));
    register_sidebar(array('name'=>'left'));
    register_sidebar(array('name'=>'right'));
    }

    and I am able to add widgets to sidebars “twitter”, “left” and “right” in the admin. In my templates I am calling the different sidebars in different locations using this (as an example):

    <?php get_sidebar('right'); ?>

    It’s not working! How do I do it correctly?

    Thanks!!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Try:

    if ( function_exists('register_sidebar') ) {
    register_sidebar(array('name'=>'twitter', 'id=>'twitter'));
    register_sidebar(array('name'=>'left', id'=>'left'));
    register_sidebar(array('name'=>'right', 'id'=>'right'));
    }
    Thread Starter semidivine

    (@semidivine)

    Ah thanks but that didn’t work. With my old code the first sidebar worked (twitter) but no other. With your code even the twitter widget didn’t show up.

    How are you calling your sidebars?

    Thread Starter semidivine

    (@semidivine)

    <?php get_sidebar('twitter'); ?>

    or

    <?php get_sidebar('left'); ?>

    or

    <?php get_sidebar('right'); ?>

    in different templates.

    And the sidebar files are called?

    Thread Starter semidivine

    (@semidivine)

    Ah good question… I wasn’t sure what to do about that and whether to put some code in the sidebar template itself.

    For now they are called sidebar.php, sidebar2.php and sidebar3.php.

    Thread Starter semidivine

    (@semidivine)

    Sorry, that wasn’t clear… I have code in the sidebar templates, but nothing to distinguish between them.

    I have:

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
    		...
    <?php endif; ?>

    Thread Starter semidivine

    (@semidivine)

    Anybody else? I still have not been able to get this to work, and searching through the forums have not found an answer…

    Try naming your sidebar files sidebar-twitter.php, sidebar-left.php and sidebar-right.php.

    Thread Starter semidivine

    (@semidivine)

    That did it!! Thanks so much.
    I wish they had documentation about this…
    Have a great day.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Have multiple widgetized sidebars for my theme but not calling them correctly’ is closed to new replies.