1
0
Fork 0
mirror of https://github.com/curtistinkers/wp-child-theme-generator.git synced 2026-03-02 20:49:04 +00:00
A child theme template generator for the TwentyTwenty-Five WordPress theme
Find a file Use this template
2025-12-18 15:10:52 -06:00
.vscode Added spell check term 2025-12-18 13:35:59 -06:00
patterns Added patterns folder so phpstan doesn't throw an error 2025-12-18 11:04:55 -06:00
scripts Added removal section 2025-12-18 14:11:42 -06:00
.editorconfig Updated sh settings 2025-12-18 13:52:52 -06:00
.gitignore Basic package setup 2025-12-18 09:25:18 -06:00
CHANGELOG.md Removed unit testing framework 2025-12-18 11:29:23 -06:00
composer.json Added a support and archive section 2025-12-18 15:01:11 -06:00
composer.lock Basic package setup 2025-12-18 09:25:18 -06:00
functions.php Replaced pascal case with standard WordPress names 2025-12-18 13:38:38 -06:00
LICENSE Added a year tag 2025-12-18 10:41:58 -06:00
phpcs.xml.dist Basic package setup 2025-12-18 09:25:18 -06:00
phpstan.neon.dist Basic package setup 2025-12-18 09:25:18 -06:00
README.md Fixed some spacing issues 2025-12-18 15:10:52 -06:00
style.css Added replacement tag to author info 2025-12-18 15:00:29 -06:00
theme.json Added required files for basic theme development 2025-12-18 09:59:26 -06:00

WordPress Child Theme Generator

Teh replace-tags script script replaces placeholder tags in key files to quickly scaffold a new WordPress child theme. The scripts/ folder may be deleted after use if desired.

Requirements

  • A POSIX-compatible shell (Git Bash, WSL, macOS, Linux).
  • perl available in the PATH (used for safe multi-line/global replacements).

Assumptions

This script assumes you are creating a child theme based on the twentytwentyfive parent theme. You'll need to adjust accordingly if using a different parent theme. Additionally, the script assumes you'll be replacing %author-name% with your GitHub username and %text-domain% with the repository name. If this is not the case, you'll need to manually adjust the generated URLs in multiple files. If you want to customize the git provider (e.g. GitLab, Codeberg, private Git server), you'll also need to manually adjust the URLs after running the script.

Usage

Run interactively (Git Bash / WSL / macOS / Linux):

bash scripts/replace-tags.sh

Run from PowerShell using WSL (if WSL is installed):

wsl bash scripts/replace-tags.sh

Notes

  • The script prompts for each placeholder and performs in-place replacements in the files:
    • composer.json
    • functions.php
    • style.css
    • theme.json
    • README.md
    • LICENSE
  • Leave an input blank to skip replacing that tag.
  • The script uses perl to correctly handle special characters and multi-line matches.
  • Back up files (or use git) before running if you want an easy revert.

Placeholders

  • %text-domain%: The text domain for the theme in kebab case (e.g., my-really-cool-theme).
  • %description%: Theme description.
  • %author-name%: Author's name.
  • %author-email%: Author's email.
  • %author-homepage%: Author's homepage URL.
  • %year%: Current year (auto-generated).
  • %function-name%: Function name derived from text domain (not prompted).
  • %class-name%: WordPress standard class name format derived from text domain (not prompted).