Title: Multiple Sidebars
Last modified: August 18, 2016

---

# Multiple Sidebars

 *  [actionbasic](https://wordpress.org/support/users/actionbasic/)
 * (@actionbasic)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/multiple-sidebars-3/)
 * On my site I have a sidebar from the blue-zinfindel theme that shows up on all
   pages of course. The problem is that I need to have more than one sidebar so 
   I can show different things when you get into the site. example: the MP3 player
   on the right should only be on the homepage.
 * [http://www.detour-mag.com/content/](http://www.detour-mag.com/content/)
 * any help would be great.
 * Thanks,
    Brandon

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

 *  [cheesemasterdan](https://wordpress.org/support/users/cheesemasterdan/)
 * (@cheesemasterdan)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/multiple-sidebars-3/#post-572197)
 * Using [Conditional Tags](http://codex.wordpress.org/Conditional_Tags) should 
   get you what you want…
    Include these in your sidebar template and use, say `
   if(is_home()){ stick your code here }` if you want something just to display 
   on the front page (though the help page seems to suggest this is handled differently
   in v2.1 but I haven’t really looked into it)…
 *  [jabecker](https://wordpress.org/support/users/jabecker/)
 * (@jabecker)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/multiple-sidebars-3/#post-572213)
 * Conditional tags work. Or, you can do what I do. edit the general-template.php
   and replace get_sidebar what I’ve pasted in below.
 * In your template, call get_sidebar with the name of your sidebar file — for example:
   get_sidebar(‘my-sidebar’). It defaults to “sidebar” so there’s no impact if you
   don’t include the file name.
 * ——–
 * `function get_sidebar($sidebar="sidebar") {`
    `if ( file_exists( TEMPLATEPATH.'/'.
   $sidebar . '.php') )` `load_template( TEMPLATEPATH . '/'. $sidebar . '.php');``
   else` `load_template( ABSPATH . 'wp-content/themes/default/sidebar.php');` `}`
 *  [mcbuzz](https://wordpress.org/support/users/mcbuzz/)
 * (@mcbuzz)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/multiple-sidebars-3/#post-572481)
 * Editing the general-template.php file (in the wp-includes folder) — replacing
   get_sidebar with the code offered by jabecker — worked great for me. Thanks jabecker!!
 * I noticed that the line
    `do_action( 'get_sidebar' );` is missing from what they
   offer. Not sure if this matters but I put it in and the function works as described.
 * So you should have
 *     ```
       function get_sidebar($sidebar="sidebar") {
       	do_action( 'get_sidebar' );
       	if ( file_exists( TEMPLATEPATH . '/' . $sidebar . '.php') )
       		load_template( TEMPLATEPATH . '/'. $sidebar . '.php');
       	else
       		load_template( ABSPATH . 'wp-content/themes/default/sidebar.php');
       }
       ```
   
 * This modification can do a lot of good work (I think) because you can do the 
   same for get_header().
 *  [mcbuzz](https://wordpress.org/support/users/mcbuzz/)
 * (@mcbuzz)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/multiple-sidebars-3/#post-572520)
 * Just an update:
 * It’s not necessary to edit the general-template.php file.
 * Just replace
 * `<?php get_header(); ?>`
 * with
 * `<?php include(TEMPLATEPATH."/whatever-header-file-you-want.php"); ?>`
 * and be sure to save the whatever-header-file-you-want.php file in the theme folder
   with all the other theme files, including the original header.php file.
 * You can do the same with sidebar files.
 * Just replace
 * `<?php get_sidebar(); ?>`
 * with
 * `<?php include(TEMPLATEPATH."/whatever-sidebar-file-you-want.php"); ?>`
 * and be sure to save the whatever-sidebar-file-you-want.php file in the theme 
   folder with all the other theme files, including the original sidebar.php file.

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

The topic ‘Multiple Sidebars’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 4 participants
 * Last reply from: [mcbuzz](https://wordpress.org/support/users/mcbuzz/)
 * Last activity: [18 years, 1 month ago](https://wordpress.org/support/topic/multiple-sidebars-3/#post-572520)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
