Add dynamic sidebars to template wrapper

This commit is contained in:
Scott Walkinshaw
2013-01-23 15:43:31 -05:00
parent 1724452e35
commit 0abc07d11c

View File

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