Title: sidebar template
Last modified: August 19, 2016

---

# sidebar template

 *  [jami1955](https://wordpress.org/support/users/jami1955/)
 * (@jami1955)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/sidebar-template/)
 * I’ve gotten nice results with defining separate headers and footers for template
   pages in the general-templage.php. However, the sidebar define statement in general-
   template.php is different than the define statements for footer.php and header.
   php, and sure enough I cannot get my template to call a different sidebar. **
   How can I get my template page to call it’s own sidebar?**
    general-template.
   php define statement:
 *     ```
       function get_sidebar( $name = null ) {
       	do_action( 'get_sidebar' );
       	if ( isset($name) && file_exists( TEMPLATEPATH . "/sidebar-{$name}.php") )
       		load_template( TEMPLATEPATH . "/sidebar-{$name}.php");
       	elseif ( file_exists( TEMPLATEPATH . '/sidebar.php') )
       		load_template( TEMPLATEPATH . '/sidebar.php');
       	else
       		load_template( WP_CONTENT_DIR . '/themes/default/sidebar.php');
       }
       ```
   
 * Thanks,
    JSC

The topic ‘sidebar template’ is closed to new replies.

## Tags

 * [general-template.php](https://wordpress.org/support/topic-tag/general-template-php/)
 * [pages](https://wordpress.org/support/topic-tag/pages/)
 * [templates](https://wordpress.org/support/topic-tag/templates/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [jami1955](https://wordpress.org/support/users/jami1955/)
 * Last activity: [17 years, 5 months ago](https://wordpress.org/support/topic/sidebar-template/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
