Get named sidebars. Props AaronCampbell. fixes #5615

git-svn-id: https://develop.svn.wordpress.org/trunk@6609 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-01-14 04:51:29 +00:00
parent d1b9e73996
commit c606c5bc63
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');