Skip to content

Instantly share code, notes, and snippets.

@mkormendy
Last active January 21, 2016 05:32
Show Gist options
  • Save mkormendy/3f514dc4aec3429edbfe to your computer and use it in GitHub Desktop.
Save mkormendy/3f514dc4aec3429edbfe to your computer and use it in GitHub Desktop.
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 if (ENV == 'dev') { echo "<!-- ////////////////////////////////////////////////////////////////////////////////////////////\n".pathinfo( __FILE__ )['dirname']."/".pathinfo( __FILE__ )['basename']."\n"."///////////////////////////////////////////////////////////////////////////////////////////// -->\n"; } ?>
<?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');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment