Get named sidebars. Props AaronCampbell. fixes #5615

git-svn-id: http://svn.automattic.com/wordpress/trunk@6609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-01-14 04:51:29 +00:00
parent f56d2616d3
commit 8c55d60d5b
1 changed files with 4 additions and 2 deletions

View File

@ -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');