WordPress.org

Plugin Directory

Test out the new Plugin Directory and let us know what you think.

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: 4.1 or higher
Compatible up to: 4.5.5
Last Updated: 9 months ago
Active Installs: 3,000+

Ratings

5 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
100,1,1
100,1,1
100,1,1
100,1,1