
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:
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.
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.
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.
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:
Examples: [revealtemplate type="absolute"], [revealtemplate type="filename" admin="0"]
A template tag is also provided which can be used to display the theme template file used to render the page.
<?php c2c_reveal_template(); ?>
By default, c2c_reveal_template() will echo the template name. To simply retrieve the template filename rather than displaying it:
<?php $template = c2c_reveal_template( false ); ?>
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:
This plugin is primarily intended to be activated on an as-needed basis.
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
The plugin provides one template tag for use in your theme templates, functions.php, or plugins.
$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
}
?>
Starting from $0 per month.
Rating
Reviewers
16 reviews
Tags
Developed By
Scott Reilly
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Contact Form plugins for Wordpress
Forms plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Comments plugins for Wordpress
Portfolio plugins for Wordpress
Maps plugins for Wordpress
Security plugins for Wordpress
Translation plugins for Wordpress
Ads plugins for Wordpress
Video Player plugins for Wordpress
Music Player plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Chat plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Tabs plugins for Wordpress
Membership plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Inventory plugins for Wordpress
Video Player plugins for Wordpress
Testimonials plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Social Feeds plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Events Calendar plugins for Wordpress
Contact plugins for Wordpress
Comments plugins for Wordpress
Analytics plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Slide in panel that appears from the top or bottom to highlight offers, capture attention, and guide visitors toward more conversions.
Add announcements to your site to share important updates, keep visitors informed, and guide them toward actions that support engagement and conversions.
Create and customize product catalogs with a catalog widget that organizes items clearly, improves browsing, and helps visitors explore your offerings easily.
Display ratings from multiple platforms in a reviews trust box that builds credibility, social proof, and boosts conversions.
Create a TDEE Calculator that helps visitors estimate daily calorie needs and make informed decisions.
Create an online restaurant menu that organizes dishes, highlights key items, and helps visitors explore options with confidence.
Show eBay reviews to build trust, strengthen credibility, and help visitors make confident purchase decisions that support higher sales.
Use a pricing slider to show dynamic prices by quantity, help visitors compare options, and support confident purchases.
Show Tripadvisor reviews to build trust, improve credibility, and help visitors make confident booking decisions that support higher property sales.
Add a no-code audio player to your site and boost engagement with music, podcasts, and voice content effortlessly.
Create engaging stop motion displays with a stop motion player that turns image sequences into interactive animations to boost creativity and visitor engagement.
Add an event agenda to your site to display schedules clearly, helping users understand timing and plan their attendance.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
