mkormendy
11/2/2015 - 7:12 AM

Outputs the path of which php file is being called, at the top of that file, in HTML comments. Very useful for finding out which theme files

Outputs the path of which php file is being called, at the top of that file, in HTML comments. Very useful for finding out which theme files and template parts are generating what part of the page.

<?php

/**
 * Development Environment Constant.
 *
 * If this is a development environment this will turn on certain debugging codes found throughout
 * theme and plugin files used for identifying code blocks and the file locations they reside in.
 *
 * Place at the end of the wp-config.php file after require_once(ABSPATH . 'wp-settings.php');
 * 
 * Comment out if on production environment.
 * 
 */
$blog_id = get_current_blog_id();
if ( $blog_id == 30 || $blog_id == 24 ) {
  define('ENV', 'dev');
}
?>
<?php if (ENV == 'dev') { echo "<!-- ////////////////////////////////////////////////////////////////////////////////////////////\n".pathinfo( __FILE__ )['dirname']."/".pathinfo( __FILE__ )['basename']."\n"."///////////////////////////////////////////////////////////////////////////////////////////// -->\n"; } ?>