Show which template is being used
-
I used this code in functions on my TwentyTen child sites to show (in the source code) which template was being used.
I just tried this with my TwentyTwelve child theme, and no luck. ?? Any chance anyone here know what to change to make it work in Twenty Twelve?It is very handy.
add_filter( 'template_include', 'var_template_include', 1000 ); function var_template_include( $t ){ $GLOBALS['current_theme_template'] = basename($t); return $t; } function get_current_template( $echo = false ) { if( !isset( $GLOBALS['current_theme_template'] ) ) return false; if( $echo ) echo $GLOBALS['current_theme_template']; else return $GLOBALS['current_theme_template']; }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Show which template is being used’ is closed to new replies.