Title: adding extra widget sidevar
Last modified: August 19, 2016

---

# adding extra widget sidevar

 *  [ikidunot](https://wordpress.org/support/users/ikidunot/)
 * (@ikidunot)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/adding-extra-widget-sidevar/)
 * my site is [http://www.ravegrounds.com](http://www.ravegrounds.com) and im trying
   to add a sidebar in the middle where the one recent post is located so the site
   would become 3 column, 2 of which would be widgetized sidebars.
 * i inserted a new sidebar called “middle” based off of the sidebar “primary” that
   already existed in the file called sidebar-init.php. everything is good at this
   point because the new menu shows up in my admin area.
 *     ```
       <?php
   
       // Register widgetized areas
   
       function the_widgets_init() {
           if ( !function_exists('register_sidebars') )
               return;
   
           register_sidebar(array('name' => 'Primary','id' => 'primary','description' => "Normal full width Sidebar", 'before_widget' => '<div id="%1$s" class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '<span> </span></h3>'));
   
           register_sidebar(array('name' => 'Middle','id' => 'middle','description' => "Normal full width Sidebar", 'before_widget' => '<div id="%1$s" class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '<span> </span></h3>'));	
   
           register_sidebar(array('name' => 'Secondary Left','id' => 'secondary-1', 'description' => "Left column (part of 2-col sidebar)", 'before_widget' => '<div id="%1$s" class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '<span> </span></h3>'));
           register_sidebar(array('name' => 'Secondary Right','id' => 'secondary-2', 'description' => "Right column (part of 2-col sidebar)", 'before_widget' => '<div id="%1$s" class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '<span> </span></h3>'));
           register_sidebar(array('name' => 'Footer 1','id' => 'footer-1', 'description' => "Widetized footer", 'before_widget' => '<div id="%1$s" class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '</h3>'));
           register_sidebar(array('name' => 'Footer 2','id' => 'footer-2', 'description' => "Widetized footer", 'before_widget' => '<div id="%1$s" class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '</h3>'));
           register_sidebar(array('name' => 'Footer 3','id' => 'footer-3', 'description' => "Widetized footer", 'before_widget' => '<div id="%1$s" class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '</h3>'));
           register_sidebar(array('name' => 'Footer 4','id' => 'footer-4', 'description' => "Widetized footer", 'before_widget' => '<div id="%1$s" class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '</h3>'));
       }
   
       add_action( 'init', 'the_widgets_init' );
   
       ?>
       ```
   
 * then i made a new file called sidebar2.php based off an file that was already
   there called sidebar.php. the new file looks like this
 *     ```
       <div id="sidebar" class="col-right">
   
       	<?php if (is_active_sidebar('middle')) : ?>
           <div class="middle">
       		<?php dynamic_sidebar('middle'); ?>
       	</div>
       	<?php endif; ?>
   
       </div><!-- /#sidebar -->
       ```
   
 * every time i post
    `<?php get_sidebar2(); ?>` in my index file, all the existing
   sidebar will disappear on my site. can someone see if i am missing something?

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/adding-extra-widget-sidevar/#post-1607445)
 * [http://codex.wordpress.org/Function_Reference/get_sidebar](http://codex.wordpress.org/Function_Reference/get_sidebar)

Viewing 1 replies (of 1 total)

The topic ‘adding extra widget sidevar’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/adding-extra-widget-sidevar/#post-1607445)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
