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.
Captivate Users With Interactive Before & After Images
Engage, Alert, and Convert with Innovative Notifications
Eye-Catching Multi-Rows Image Slides
Create Beautiful, Customizable Menus for Your Restaurant Website
Engage Visitors with a Dynamic and Interactive Card Slider
Increase Your Chances of Getting Hired With the Skill Flip Cards App
Increase Conversions With Restaurant Menu Flip Cards
Showcase Progress in a Beautiful, Animated, Visual Representation
Enrich Content & Increase User Engagement With a Social Votes App
Maximize Video Impact by Keeping Content Always in View
Increase Trust & Improve Credibility To Drive Sales Up
Offer Valuable Information and Promote Your Products With a PDF Viewer Gallery
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!