WordPress Page Template Detection Script
- by Seth Carstens
- March 5, 2012
Ever got stuck wondering which page wordpress is actually loading? Wonder no more! Simply add this text to your functions file, save, upload and refresh. Viola, it will print the page template WordPress is trying to load so you know exactly which file to modify and bend to your every whim.
|
1 2 3 4 5 |
add_action('wp_head', 'show_template'); function show_template() { global $template; print_r($template); }<a href="http://sethmatics.com/wp-content/uploads/page-template-detection-promo-1.png"><img class="alignleft size-medium wp-image-1653" title="page-template-detection-promo-1" src="http://sethmatics.com/wp-content/uploads/page-template-detection-promo-1-625x198.png" alt="" width="625" height="198" /></a> |
