Title: 2 different sidebars
Last modified: August 18, 2016

---

# 2 different sidebars

 *  [hopeworks](https://wordpress.org/support/users/hopeworks/)
 * (@hopeworks)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/2-different-sidebars/)
 * I am using the blixed theme.
 * I have a static front page.
 * I would like to have a different sidebar for the posts page then the static front
   page. Using widgets on both.
 * Any help? Thanks.
    [youpickthesermon.com](http://www.youpickthesermon.com)

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

 *  [davidemorgan](https://wordpress.org/support/users/davidemorgan/)
 * (@davidemorgan)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/2-different-sidebars/#post-663805)
 * In functions.php, if you’re already widgetized you’ll find this (if not add it):
 *     ```
       if ( function_exists('register_sidebar') )
       register_sidebar();
       ```
   
 * To do multiple sidebars you’ll need this, too:
 *     ```
       if ( function_exists('register_sidebars') )
       register_sidebars(2);
       ```
   
 * The (2) represents your 2 sidebars. If you want 3, put in 3, and so on.
 * Now in your sidebar.php, we’re going to mess with the code a bit. Where you currently
   find:
 * `<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>`
 * Replace with this:
 *     ```
       <?php if (is_home()) {
       if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else :
       } else {
       if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : else : } ?>
       //Put in stuff that'd show in case of no widgets
       <?php endif; ?>
       ```
   
 * I’m sure there’s a cleaner way to do it, but…
    - dynamic_sidebar(1) will show on your home page and
    - dynamic_sidebar(2) will show on every other page
 * At least it should. Haven’t tried it. Hope it works.
 *  [davidemorgan](https://wordpress.org/support/users/davidemorgan/)
 * (@davidemorgan)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/2-different-sidebars/#post-663809)
 * Parse errors. Never mind me.
 *  [davidemorgan](https://wordpress.org/support/users/davidemorgan/)
 * (@davidemorgan)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/2-different-sidebars/#post-663812)
 * Okay, do what I said in functions.php, but in your sidebar.php, but this instead:
 *     ```
       <?php if ( function_exists('dynamic_sidebar')):
       if (is_home()) dynamic_sidebar(1);
       else dynamic_sidebar(2);
       endif; ?>
       ```
   
 *  Thread Starter [hopeworks](https://wordpress.org/support/users/hopeworks/)
 * (@hopeworks)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/2-different-sidebars/#post-663882)
 * I get two sidebars in widgets panel but no sidebars show up on site.
 * here is the code (w/o your changes)
 *     ```
       <?php
       if ( function_exists('register_sidebar') )
       {
       register_sidebar(array('before_widget' => '',
       		'after_widget' => '',
       		'before_title' => '<h2><em>',
       		'after_title' => '</em></h2>',
       		));
       }
       ```
   
 * `<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar() ) : else :?
   >`
 *  [epulula](https://wordpress.org/support/users/epulula/)
 * (@epulula)
 * [18 years ago](https://wordpress.org/support/topic/2-different-sidebars/#post-664198)
 * Could someone explain me what is the meaning of this statement:
 * <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(1) ) : ?>
 *  [palamedes](https://wordpress.org/support/users/palamedes/)
 * (@palamedes)
 * [18 years ago](https://wordpress.org/support/topic/2-different-sidebars/#post-664199)
 * That is a simple line of PHP which says this;
 * IF the function “dydnamic_sidebar” doesn’t exist or running the function dynamic_sidebar(
   1) didn’t output anything then execute the following code until “else” or “endif”

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

The topic ‘2 different sidebars’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 4 participants
 * Last reply from: [palamedes](https://wordpress.org/support/users/palamedes/)
 * Last activity: [18 years ago](https://wordpress.org/support/topic/2-different-sidebars/#post-664199)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
