An intuitive WordPress child theme boilerplate with basic setup of VSCode, Prettier and CodeSniffer to enforce a consistent HTML, CSS, JavaScript & PHP coding styles taking care of the WordPress coding conventions.
To start using all the project's tools you need to install the necessary dependencies with Node.js and Composer:
npm install
composer install
Edit the theme.json
file on project's root with your child theme variables and execute:
npm run setup
The child theme is ready — Happy coding! 🤖
{
"parent_theme_name": "The name of the parent-theme",
"TextDomain": "Theme text domain for i18n",
"Theme_Name": "It appears on code comment's headers",
"THEME_NAME_": "Global variables",
"ThemeName": "Namespaces"
}
Set the path to a PHP 7+ executable in your VSCode settings.json
or in the workspace, example:
{
"php.executablePath": "/Applications/XAMPP/xamppfiles/bin/php"
}
{
"php.executablePath": "/usr/local/bin/php",
"php.validate.executablePath": "/usr/local/bin/php",
}
- 💬 If you have a question or suggestion leave a message on Issues section.
- 🐞 You can open a Pull Request to add new features or fix a bug.
Unintended behavior using MacOS with built-in PHP (php@7.4 || php@8.0 should fix the following on VSCode extensions):
phpcs
extension doesn't lint correctly (PHP 8.1)phpcbf
extension doesn't format using WPCS sniffs (PHP 8.1)
# Switching between PHP versions (homebrew macOS)
brew install php@8.0
brew unlink php
brew link php@8.0
📄 The project documentation is available at ...
- Prettier configuration
- PHP_CodeSniffer repository
- WordPress Coding Standards for PHP_CodeSniffer
- phpcs extension for VSCode
- phpcbf extension for VSCode
- Official WordPress Developer Resources
- phpDocumentor
This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License.