The Current Template Name

This will output the name of the template being called on any particular page or post or archive.

<?php 
   global $template; 
   $name = $template_name = substr( $template, ( strripos( $template, '/') ) ); 
   echo $name; 
?>

 

Comments are closed.

Skip to toolbar