Skip to content

Instantly share code, notes, and snippets.

@alexpos
Created March 24, 2013 15:29
Show Gist options
  • Save alexpos/5232338 to your computer and use it in GitHub Desktop.
Save alexpos/5232338 to your computer and use it in GitHub Desktop.
Add the below snippet into your functions.php file and it will return the current theme template WordPress is using in the console.
function templatedebug() {
global $template; $curtemplate=basename($template);
?>
<script type="text/javascript">
console.log(<?php echo "\"current template: ".$curtemplate."\""; ?>);
</script>
<?php
}
add_action( 'wp_footer', 'templatedebug' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment