From 0abc07d11c5ab0a7d16ec526d884bfc8acb63858 Mon Sep 17 00:00:00 2001 From: Scott Walkinshaw Date: Wed, 23 Jan 2013 15:43:31 -0500 Subject: [PATCH 1/3] Add dynamic sidebars to template wrapper --- lib/utils.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/utils.php b/lib/utils.php index 0b07bb1..223b3d7 100644 --- a/lib/utils.php +++ b/lib/utils.php @@ -45,8 +45,11 @@ function roots_template_path() { return Roots_Wrapping::$main_template; } -class Roots_Wrapping { +function roots_sidebar_path() { + return Roots_Wrapping::sidebar(); +} +class Roots_Wrapping { // Stores the full path to the main template file static $main_template; @@ -65,7 +68,17 @@ class Roots_Wrapping { $templates = array('base.php'); if (self::$base) { - array_unshift($templates, sprintf('base-%s.php', self::$base )); + array_unshift($templates, sprintf('base-%s.php', self::$base)); + } + + return locate_template($templates); + } + + static function sidebar() { + $templates = array('templates/sidebar.php'); + + if (self::$base) { + array_unshift($templates, sprintf('templates/sidebar-%s.php', self::$base)); } return locate_template($templates); From f6f86aa2686e74b20da8305974ffae1eabe2de32 Mon Sep 17 00:00:00 2001 From: Scott Walkinshaw Date: Wed, 23 Jan 2013 15:44:21 -0500 Subject: [PATCH 2/3] Replace sidebar template call with path function --- base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base.php b/base.php index 9133ed7..89d618b 100644 --- a/base.php +++ b/base.php @@ -19,7 +19,7 @@ From 429cd0b3becb55da735f06b6223956aa41fcaafa Mon Sep 17 00:00:00 2001 From: Scott Walkinshaw Date: Wed, 23 Jan 2013 15:52:10 -0500 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bac43c4..db764c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ### HEAD +* Add support for dynamic sidebar templates * Fix PHP notice on search with no results * Update to jQuery 1.9.0