WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Reveal Template

Reveal the theme template file used to render the displayed page, via the footer, widget, shortcode, and/or template tag.

Template Tags

The plugin provides one template tag for use in your theme templates, functions.php, or plugins.

Functions

  • <?php function c2c_reveal_template( $echo = true, $template_path_type = '' ) ?> Formats for output the template path info for the currently rendered template.

Arguments

  • $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.

Examples

  • <?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.6 or higher
Compatible up to: 3.8.3
Last Updated: 2013-12-28
Downloads: 11,048

Ratings

4 stars
4.7 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1
100,1,1
50,2,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1