Skip to content

Instantly share code, notes, and snippets.

View stevenhoney's full-sized avatar

Steve stevenhoney

  • New Zealand
  • 02:50 (UTC +12:00)
View GitHub Profile
@theMikeD
theMikeD / template_debugging.php
Created May 16, 2016 21:03
Puts some helpful wordpress template info into the html document head
/**
* Insert the template in use and the page ID into <head> of the document src.
*/
add_action( 'wp_head', 'cnmd_debug_insert_template_info_into_src' );
function cnmd_debug_insert_template_info_into_src() {
global $template;
global $post;
// Get the path part
$url = parse_url($template, PHP_URL_PATH);