Title: get_sidebar
Last modified: August 19, 2016

---

# get_sidebar

 *  [slavix](https://wordpress.org/support/users/slavix/)
 * (@slavix)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/get_sidebar/)
 * Hello,
    I am having trouble getting my sidebars working properly.. My templates
   says
 *     ```
       <?php get_sidebar('left'); ?>
       ..
       <?php get_sidebar('right'); ?>
       ```
   
 * and that loads sidebar-left.php and sidebar-right.php that I have defined.
    My
   functions.php has
 *     ```
       if ( function_exists('register_sidebar') )
       	register_sidebar(array(
       		'name' => 'left',
       		'before_widget' => '<li>',
       		'after_widget' => '</li>',
       		'before_title' => '<h4>',
       		'after_title' => '</h4>',
       	));
       	register_sidebar(array(
       		'name' => 'right',
       		'before_widget' => '<li>',
       		'after_widget' => '</li>',
       		'before_title' => '<h4>',
       		'after_title' => '</h4>',
       	));
       ```
   
 * And I see these sidebars named ‘left and ‘right’ show up in widgets menu. I tried
   adding widgets to the sidebars, but they don’t show up on my sidebars.. where
   is the problem?
 * thanks,
    Slava

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/get_sidebar/#post-1279763)
 * What are your sidebar files called? They should be sidebar-left.php and sidebar-
   right.php.
 *  Thread Starter [slavix](https://wordpress.org/support/users/slavix/)
 * (@slavix)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/get_sidebar/#post-1279774)
 * As I mentioned in the original post the sidebar files are named sidebar-left.
   php and sidebar-right.php
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/get_sidebar/#post-1279782)
 * Sorry – missed that.
 * There’s a missing closing `}` in your functions.php code. Is that just a copy’n’paste
   error?
 * What’s in your sidebar files?
 *  [miocene22](https://wordpress.org/support/users/miocene22/)
 * (@miocene22)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/get_sidebar/#post-1279812)
 * Try removing the final trailing commas for each of the sidebar arrays in functions.
   php. The last item in the array should not have a comma
 *  Thread Starter [slavix](https://wordpress.org/support/users/slavix/)
 * (@slavix)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/get_sidebar/#post-1280001)
 * ok. made the changes, but it still does not work..
    functions.php:
 *     ```
       <?php
       if ( function_exists('register_sidebar') ) {
       	register_sidebar(array(
       		'name' => 'left',
       		'before_widget' => '<li>',
       		'after_widget' => '</li>',
       		'before_title' => '<h4>',
       		'after_title' => '</h4>'
       	));
       	register_sidebar(array(
       		'name' => 'right',
       		'before_widget' => '<li>',
       		'after_widget' => '</li>',
       		'before_title' => '<h4>',
       		'after_title' => '</h4>'
       	));
       }
       ?>
       ```
   
 * sidebar-left.php:
 *     ```
       <div id="right_sidebar" class="tRightSidebar">
           <p>
               <img src="<?php echo bloginfo('template_url'); ?>/images/template/tSpacerRightColumn.gif" width="210" height="40" />
           </p>
           <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('right_sidebar') ) : else : ?>
   
                           <?php wp_list_bookmarks('category_before=<div id="tRightColumnInset1">&category_after=</div>&title_before=<h4>&title_after=</h4>&categorize=1&category=2,7,6&orderby=id&category_orderby=id&show_description=0'); ?>
           <?php endif; ?>
       </div>
       ```
   
 * sidebar-left.php:
 *     ```
       <div id="left_sidebar" class="tLeftSidebar">
   
       </div>
       ```
   
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/get_sidebar/#post-1280002)
 * Try:
 * sidebar-left.php:
 *     ```
       <div id="right_sidebar" class="tRightSidebar">
           <p>
               <img src="<?php echo bloginfo('template_url'); ?>/images/template/tSpacerRightColumn.gif" width="210" height="40" />
           </p>
           <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('right') ) : else : ?>
   
                           <?php wp_list_bookmarks('category_before=<div id="tRightColumnInset1">&category_after=</div>&title_before=<h4>&title_after=</h4>&categorize=1&category=2,7,6&orderby=id&category_orderby=id&show_description=0'); ?>
           <?php endif; ?>
       </div>
       ```
   
 * sidebar-left.php:
 *     ```
       <div id="left_sidebar" class="tLeftSidebar">
       <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('left')) : ?>
       <?php endif;?>
       </div>
       ```
   
 *  Thread Starter [slavix](https://wordpress.org/support/users/slavix/)
 * (@slavix)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/get_sidebar/#post-1280003)
 * thanks! that worked.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘get_sidebar’ is closed to new replies.

## Tags

 * [get_sidebar](https://wordpress.org/support/topic-tag/get_sidebar/)
 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)

 * 7 replies
 * 3 participants
 * Last reply from: [slavix](https://wordpress.org/support/users/slavix/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/get_sidebar/#post-1280003)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
