Visit us on FacebookVisit us on TwitterVisit us on YoutubeVisit us on SteamVisit us on TwitchCheck out our Feed


Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.

Pages: [1]
Author Topic: Wordpress 3.7.1 show current template
Posts: 12
Post Wordpress 3.7.1 show current template
on: November 25, 2013, 16:56

Place the following code in your themes functions.php

// Grabbing current page template 
add_filter( 'template_include', 'var_template_include', 1000 ); 
function var_template_include( $t ){ 
  $GLOBALS['current_theme_template'] = basename($t); 
  return $t; 
function get_current_template( $echo = false ) { 
  if( !isset( $GLOBALS['current_theme_template'] ) ) return false;  
  if( $echo ) echo $GLOBALS['current_theme_template']; else  return $GLOBALS['current_theme_template']; 

Then place the following code in the page you want to see what template is being used.

$page = get_current_template();
echo $page;
Pages: [1]

Looking for something?

Use the form below to search

Still not finding what you're looking for?
Contact us so we can take care of it!