Forums

get_sidebar not getting sidebar (6 posts)

  1. gmdavis
    Member
    Posted 2 years ago #

    I reviewed the docs for get_sidebar at:
    http://codex.wordpress.org/Function_Reference/get_sidebar

    They say to include more than one sidebar, I put in index.php something like:

    ...
    <div id='left'>
    <?php get_sidebar('left); ?>
    </div>
    <div id='right'>
    <?php get_sidebar('right); ?>
    </div>
    ...

    Then, in my theme's folder, I have 2 files (identical in content) sidebar-left.php and sidebar-right.php.

    In Dashboard/Appearance/Widgets there are now indeed 2 sidebars to widgetize.

    However, when I visit my site, the same sidebar shows up on both sides.

    What could I be doing wrong? IS there another file in my themes that I need to alter?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    You're missing the closing single quote on the sidebar names:

    <div id='left'>
    <?php get_sidebar('left'); ?>
    </div>
    <div id='right'>
    <?php get_sidebar('right'); ?>
    </div>
  3. gmdavis
    Member
    Posted 2 years ago #

    Thanks esmi but that's not it.

    That was my typo while posting in the forum. Actually, if I really was missing the quotes, it wouldn't work at all.

  4. alchymyth
    The Sweeper
    Posted 2 years ago #

    what is the register sidebars code in your functions.php ?
    what is the code in your sidebar-left/right.php ?

  5. gmdavis
    Member
    Posted 2 years ago #

    The code in the sidebars is untouched form the default "sidebar.php".

  6. alchymyth
    The Sweeper
    Posted 2 years ago #

    did you actually drag different widgets into the different sidebars?

    as you know, without widgets dragged into the sidebars, they will just show some default code that was hardcoded into the sidebar-abc.php.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags