From c606c5bc6397f0eef9b039070f022f8305ee8088 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 14 Jan 2008 04:51:29 +0000 Subject: [PATCH] Get named sidebars. Props AaronCampbell. fixes #5615 git-svn-id: https://develop.svn.wordpress.org/trunk@6609 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 ad9913ab6e..33d3bb9ac3 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');