Skip to content

whoisjorge/wordpress-child

Repository files navigation

wordpress-child

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.

Requirements

  • Composer (PHP >=7.4)
  • Node (LTS >=14 recommended)
  • VSCode (with recommended extensions installed)

Installation

To start using all the project's tools you need to install the necessary dependencies with Node.js and Composer:

npm install
composer install

Initial Setup

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! 🤖

Configuration

theme.json

{
  "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"
}

PHP 7+

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",
}

Developer

  • 💬 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.

Known Issues

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

Useful Documentation

📄 The project documentation is available at ...

License

This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License.

About

:octocat: An open-source WordPress starter child theme with simple yet delightful development setup.

Topics

Resources

License

Stars

Watchers

Forks