From 8c55d60d5b967ee1e2ecd67494a0139f207ac77c Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 14 Jan 2008 04:51:29 +0000 Subject: [PATCH] Get named sidebars. Props AaronCampbell. fixes #5615 git-svn-id: http://svn.automattic.com/wordpress/trunk@6609 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index ad9913ab6..33d3bb9ac 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -20,9 +20,11 @@ function get_footer() { } -function get_sidebar() { +function get_sidebar( $name = null ) { do_action( 'get_sidebar' ); - if ( file_exists( TEMPLATEPATH . '/sidebar.php') ) + 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( ABSPATH . 'wp-content/themes/default/sidebar.php');