Last active
January 7, 2024 11:59
Revisions
-
scribu revised this gist
Aug 17, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ <?php # License: Public Domain # I recommend replacing 'my_' with your own prefix. -
scribu revised this gist
Aug 17, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ <?php # License: Public Domain. # I recommend replacing 'my_' with your own prefix. function my_template_path() { -
Cristi Burcă revised this gist
Sep 4, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,11 +3,11 @@ # I recommend replacing 'my_' with your own prefix. function my_template_path() { return My_Wrapping::$main_template; } function my_template_base() { return My_Wrapping::$base; } -
Cristi Burcă revised this gist
Sep 4, 2012 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,17 @@ <?php # This code is in the Public Domain. # I recommend replacing 'my_' with your own prefix. function my_template_path() { return APP_Wrapping::$main_template; } function my_template_base() { return APP_Wrapping::$base; } class My_Wrapping { /** * Stores the full path to the main template file @@ -38,4 +40,4 @@ static function wrap( $template ) { } } add_filter( 'template_include', array( 'My_Wrapping', 'wrap' ), 99 ); -
Cristi Burcă revised this gist
Nov 5, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,4 +38,4 @@ static function wrap( $template ) { } } add_filter( 'template_include', array( 'APP_Wrapping', 'wrap' ), 99 ); -
scribu renamed this gist
Sep 11, 2011 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
scribu revised this gist
Sep 11, 2011 . 1 changed file with 4 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ <?php function app_template_path() { return APP_Wrapping::$main_template; } function app_template_base() { return APP_Wrapping::$base; } @@ -14,12 +14,12 @@ class APP_Wrapping { /** * Stores the full path to the main template file */ static $main_template; /** * Stores the base name of the template file; e.g. 'page' for 'page.php' etc. */ static $base; static function wrap( $template ) { self::$main_template = $template; @@ -36,14 +36,6 @@ class APP_Wrapping { return locate_template( $templates ); } } add_filter( 'template_include', array( 'APP_Wrapping', 'wrap' ) ); -
scribu revised this gist
Sep 11, 2011 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,14 @@ function app_template_base() { class APP_Wrapping { /** * Stores the full path to the main template file */ private static $main_template; /** * Stores the base name of the template file; e.g. 'page' for 'page.php' etc. */ private static $base; static function wrap( $template ) { -
scribu renamed this gist
Sep 11, 2011 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
scribu created this gist
Sep 11, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ <?php function app_template_path() { return APP_Wrapping::get_main_template(); } function app_template_base() { return APP_Wrapping::get_base(); } class APP_Wrapping { private static $main_template; private static $base; static function wrap( $template ) { self::$main_template = $template; self::$base = substr( basename( self::$main_template ), 0, -4 ); if ( 'index' == self::$base ) self::$base = false; $templates = array( 'wrapper.php' ); if ( self::$base ) array_unshift( $templates, sprintf( 'wrapper-%s.php', self::$base ) ); return locate_template( $templates ); } static function get_main_template() { return self::$main_template; } static function get_base() { return self::$base; } } add_filter( 'template_include', array( 'APP_Wrapping', 'wrap' ) );