No results available
ResetNew Feature: Earn 12 Badges
Collect up to 12 exclusive badges by sharing your plugin collections and engaging with the community.
See all Badgesby Scott Reilly
Description
Designers and developers know that it can sometimes be confusing and frustrating to determine the exact template being utilized to render the currently displayed page in WordPress. Sometimes page or category specific templates exist, or a page/post has been set by the post author to use a particular template, or the current theme doesn’t employ certain templates causing WordPress to fall back to others.
This plugin relieves that aggravation by assisting designers and developers by displaying the template being used to render the currently displayed page in WordPress. This can be shown in one or more of the following methods:
Admin bar
By default, the theme-relative path to the theme template file used to render the page is shown in the admin bar. The settings page for the plugin, at ‘Design’ -> ‘Reveal Template’, allows you to control and configure this particular method. Note: even if enabled by the setting, the admin bar entry also only appears if the admin bar is showing and if the user has the ability to see the revealed template.
Site footer
By default, the theme-relative path to the theme template file used to render the page is shown in the site’s footer. The settings page for the plugin, at ‘Design’ -> ‘Reveal Template’, allows you to control and configure this particular method. Note: even if enabled by the setting, the footer output only appears if the theme follows the recommended practice of calling the
wp_footer()
template tag at some point and the user has the ability to see the revealed template.
Widget
A widget named “Reveal Template” is made available which can be used to display the theme template file used to render the page in any widget location.
Shortcode
A shortcode called ‘revealtemplate’ is made available which can be used in post/page content to display the theme template file used to render the page. Currently it supports two possible attributes:
‘admin’ : Can either be 1 or 0 to indicate if the template name should be revealed to admins only. 1 means to admins only, 0 to all visitors. The default is 1.
‘type’ : The template path types. Must be one of ‘absolute’, ‘filename’, ‘relative’, or ‘theme-relative’. Read the documentation for more information on what each of these mean.
Examples:
[revealtemplate type=”absolute”]
,
[revealtemplate type=”filename” admin=”0″]
Template Tag
A template tag is also provided which can be used to display the theme template file used to render the page.
By default,
c2c_reveal_template()
will echo the template name. To simply retrieve the template filename rather than displaying it:
The template tag also takes a second argument which be can be one of the following: absolute, relative, theme-relative, filename. This determines the path style you’d like reported. If not specified, it uses the default defined in the plugin’s settings page.
Examples of path types:
“absolute” : /usr/local/www/yoursite/wp-content/themes/yourtheme/single.php
“relative” : wp-content/themes/yourtheme/single.php
“theme-relative” : yourtheme/single.php
“filename” : single.php
This plugin is primarily intended to be activated on an as-needed basis.
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
Template Tags
The plugin provides one template tag for use in your theme templates, functions.php, or plugins.
Functions
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
All texts and images on this product page are protected by copyright and are the property of the author Scott Reilly. You will be redirected to the retailer to download the plugin. We act solely as a search engine for plugins and are not affiliated with the retailer or Scott Reilly.
Get your first Badge
Earn your first badge by sharing your collections. Every master was once a beginner. Welcome to your coding journey.
Click the symbol on the desired plugin to create a collection. The symbol appears when you hover over the plugin.