Title: Add new Sidebar
Last modified: August 20, 2016

---

# Add new Sidebar

 *  [marco80](https://wordpress.org/support/users/marco80/)
 * (@marco80)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/add-new-sidebar/)
 * Hi,
 * I’m new to WP and have a question related to the Main Sidebar. I’m using Twelve
   Eleven template which has only one Main Sidebar and I need two.
 * I’ve modified the function.php file and added the following code which has created
   new sidebar called Main Sidebar10. I’ve also created a file called sidebar10-
   page.php and added its reference into the function.php.
 * My problem is that when I go into a page I can’t see the Main Sidebar10 as option
   in the Template.
 * Any suggestion?
    Thanks for your help Marco
 * register_sidebar( array(
    ‘name’ => __( ‘Main Sidebar10’, ‘twentyeleven’ ), ‘
   id’ => ‘sidebar-10’, ‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”
   >’, ‘after_widget’ => “</aside>”, ‘before_title’ => ‘<h3 class=”widget-title”
   >’, ‘after_title’ => ‘</h3>’,

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/add-new-sidebar/#post-3062358)
 * btw: do not edit Twenty Eleven directly, but create a child theme first, to work
   with; [http://codex.wordpress.org/Child_Themes](http://codex.wordpress.org/Child_Themes)
 * [http://codex.wordpress.org/Widgetizing_Themes](http://codex.wordpress.org/Widgetizing_Themes)
 * the posted code would only bring the new widget area into _**dashboard – appearance–
   widgets**_.
 * you still need to programm a space to output the widgets into a template or a
   new sidebar file;
 * [http://codex.wordpress.org/Function_Reference/dynamic_sidebar](http://codex.wordpress.org/Function_Reference/dynamic_sidebar)
 * > created a file called sidebar10-page.php
 * what is the code of that file?
    (for posting code – see [http://codex.wordpress.org/Forum_Welcome#Posting_Code](http://codex.wordpress.org/Forum_Welcome#Posting_Code))
 *  Thread Starter [marco80](https://wordpress.org/support/users/marco80/)
 * (@marco80)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/add-new-sidebar/#post-3062399)
 * Hi and thanks for your quick reply.
 * THis is the code I put in sidebar10-page.php
 * <?php
    /** * Template Name: Sidebar Template * Description: A Page Template that
   adds a sidebar to pages * * [@package](https://wordpress.org/support/users/package/)
   WordPress * @subpackage Twenty_Eleven * [@since](https://wordpress.org/support/users/since/)
   Twenty Eleven 1.0 */
 * get_header(); ?>
 *  <div id=”primary”>
    <div id=”content” role=”main”>
 *  <?php while ( have_posts() ) : the_post(); ?>
 *  <?php get_template_part( ‘content’, ‘page’ ); ?>
 *  <?php comments_template( ”, true ); ?>
 *  <?php endwhile; // end of the loop. ?>
 *  </div><!– #content –>
    </div><!– #primary –>
 * <?php get_sidebar(); ?>
    <?php get_footer(); ?>
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/add-new-sidebar/#post-3062441)
 * _please read [http://codex.wordpress.org/Forum\_Welcome#Posting\_Code](http://codex.wordpress.org/Forum_Welcome#Posting_Code)
   for posting code, and apply those guidelines._
 * this line
 *     ```
       <?php get_sidebar(); ?>
       ```
   
 * will call the default sidebar.php;
 * to call your new widget area, you need to create a different sidebar file, for
   example _**sidebar-ten.php **_and call it with
 *     ```
       <?php get_sidebar('ten'); ?>
       ```
   
 * in this sidebar file, you need to use for instance
 *     ```
       <?php dynamic_sidebar('sidebar-10'); ?>
       ```
   

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

The topic ‘Add new Sidebar’ is closed to new replies.

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/add-new-sidebar/#post-3062441)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
