Version: 2.2 Reveal the theme template file used to render the displayed page, via the footer and/or template tag.
The plugin provides one template tag for use in your theme templates, functions.php, or plugins.
<?php function c2c_reveal_template( $echo = true, $template_path_type = '' ) ?>
Formats for output the template path info for the currently rendered template.$echo (bool)
Optional. Echo the template info? Default is true.
$template_path_type (string)
Optional. The style of the template's path for return. Accepts: 'absolute', 'relative', 'theme-relative', 'filename'. Default is '', which causes the function to use the template path type configured via the plugin's settings page.
<?php //Output the current template
c2c_reveal_template( true, 'theme-relative' );
?>
<?php // Retrieve the value for use in code, so don't display/echo it.
$current_template = c2c_reveal_template( false, 'filename' );
if ( $current_template == 'category-12.php' ) {
// Do something here
}
?>
Requires: 3.1 or higher
Compatible up to: 3.3.2
Last Updated: 2011-7-12
Downloads: 3,104
Got something to say? Need help?