Your WordPress local development environment #Your WordPress local development environment
For developing WordPress themes, you need to set up a development environment suited to WordPress. There are a number of options, including:
- A LAMP stack (Linux Apache MySql PHP). This is a local server (much like the server that runs on your web server). You can install pre-bundled programs that contain all of these, like XAMPP or MAMP.
- Vagrant to create easily reproducible development environments. A popular option is Varying Vagrant Vagrants (VVV), which creates a WordPress development environment.
The WP_DEBUG PHP constant is used to trigger the built-in “debug” mode on your WordPress installation. This allows you to view errors in your theme. To enable it:
1. Open your WordPress installation’s wp-config.php file
define( 'WP_DEBUG', false );to
define( 'WP_DEBUG', true );.
Note:While normally set to ‘false’ in the wp-config.php file, in development copies of WordPress—alpha and beta versions of the upcoming release—WP_DEBUG is already set to ‘true’ by default.
Other WordPress Development Tools #Other WordPress Development Tools
In addition to WP_DEBUG, the following plugins and unit test data sets are an important part of your development toolset and help you develop better WordPress themes.
WordPress.org Theme Unit Test Data
WordPress.org Theme Unit Test Data is an XML file containing dummy test data that you can upload to test how themes perform with different types and layouts of content.
WordPress.com Theme Unit Test Data
WordPress.com Theme Unit Test Data is dummy test data that you can upload to a WordPress installation to test your theme, including WordPress.com-specific features.
Developer (WordPress plugin)
Developer helps optimize your development environment by allowing easy installation of tools and plugins that help in troubleshooting and ensuring code quality.
Theme-Check (WordPress plugin)
Theme-Check tests your theme for compliance with the latest WordPress standards and practices.
WordPress Theme Review Guidelines #WordPress Theme Review Guidelines
In addition to the above development tools, it’s a good idea to stay up to date on the WordPress.org Theme Review Team’s Guidelines for theme submission. These guidelines are the “gold standard” for quality theme development and are useful, even if you don’t plan on releasing a theme on WordPress.org.