Reveal Template

Reveal Template

Wordpress plugin

Install on Wordpress

App Details

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.

<?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:

  • “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

  • <?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
    }
    ?>

Pricing

Starting from $0 per month.

Check Out the Collapsible Content Widget

By Common Ninja

Collapsible ContentTry For Free!

App Info

Rating

Reviewers

16 reviews

Tags

debug
presentation
template
theme

Developed By

Scott Reilly

Quick & Easy

Find the Best Wordpress plugins for you

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

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Collapsible Content for Wordpress logo

Collapsible Content

Use Collapsible Content sections to structure information on your site and make it easier for visitors to find what they need.

Vimeo Slider for Wordpress logo

Vimeo Slider

Show Vimeo videos with a Vimeo slider that displays clips in a smooth slider to boost engagement and keep visitors watching.

Event List for Wordpress logo

Event List

Use an event list to highlight upcoming activities, improve visibility, and help visitors discover events that increase attendance and engagement.

LinkedIn Feed Slider for Wordpress logo

LinkedIn Feed Slider

Show LinkedIn posts with a slider that auto updates, presents content in a smooth layout, and keeps visitors engaged.

Poll for Wordpress logo

Poll

Create interactive polls with a poll widget that gathers real time feedback, boosts engagement, and helps you understand visitor opinions quickly and clearly.

Reddit Feed for Wordpress logo

Reddit Feed

Show Reddit posts with a Reddit feed that updates automatically, improves content discovery, and keeps visitors engaged with fresh discussions.

Coupon Bar for Wordpress logo

Coupon Bar

Display discounts with a coupon bar that highlights special offers, drives urgency, and helps convert visitors into paying customers.

WordPress Feed for Wordpress logo

WordPress Feed

Show WordPress posts with a WordPress feed that keeps content fresh, improves navigation, and helps visitors discover more of your site.

Agenda for Wordpress logo

Agenda

Add an event agenda to your site to display schedules clearly, helping users understand timing and plan their attendance.

Vimeo Carousel for Wordpress logo

Vimeo Carousel

Show Vimeo videos with a Vimeo carousel that displays clips in a smooth, flexible layout to boost visibility and engagement.

PDF Flipbook for Wordpress logo

PDF Flipbook

Transform PDFs into interactive flipbooks with a PDF flipbook widget that improves reading and keeps visitors engaged.

Nudge Button for Wordpress logo

Nudge Button

Nudge button with a subtle shaking animation that draws attention to important calls to action, increases interaction, and helps boost conversions.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

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!

Multiple platforms