We’re working on something like a series providing tips and talking about building solid WordPress themes. Today’s short tip is about setting debug options in your wp-config.php file.
WP_DEBUG handles error display in WordPress. If you’re building a theme you need to make sure that no errors are a result of your theme. You can set WP_DEBUG by:
define( ‘WP_DEBUG’, true );
define( ‘SCRIPT_DEBUG’, true );
PHP has lots of error logging available so why don’t we also enable all of the error logs we can get out of PHP. You can do this directly out of your wp-config.php file with the following lines.
When you build any theme you should make sure that all of these are enabled (at least on development) and that nothing you’re doing is providing any errors for the site. When you do this you’ll also find a number of plugins that will fill the error logs. If you can find an alternative that doesn’t throw any errors.
If you’re looking for other posts in this series look at the tag Building Quality WordPress Themes.