{"id":18809263,"url":"https://github.com/thingsym/wp-theme-boilerplate","last_synced_at":"2025-08-09T15:15:17.192Z","repository":{"id":37703142,"uuid":"187450698","full_name":"thingsym/wp-theme-boilerplate","owner":"thingsym","description":"Next Generation WordPress Theme Starter Kit","archived":false,"fork":false,"pushed_at":"2022-12-03T10:07:58.000Z","size":1006,"stargazers_count":23,"open_issues_count":18,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-01T20:23:06.363Z","etag":null,"topics":["starter-theme","wordpress","wordpress-boilerplate","wordpress-theme"],"latest_commit_sha":null,"homepage":"https://blog.thingslabo.com/archives/wp-theme-boilerplate.html","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thingsym.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-19T08:13:27.000Z","updated_at":"2023-11-04T20:45:50.000Z","dependencies_parsed_at":"2023-01-23T22:45:49.860Z","dependency_job_id":null,"html_url":"https://github.com/thingsym/wp-theme-boilerplate","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsym%2Fwp-theme-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsym%2Fwp-theme-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsym%2Fwp-theme-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsym%2Fwp-theme-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thingsym","download_url":"https://codeload.github.com/thingsym/wp-theme-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223602618,"owners_count":17171952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["starter-theme","wordpress","wordpress-boilerplate","wordpress-theme"],"created_at":"2024-11-07T23:15:48.468Z","updated_at":"2024-11-07T23:15:49.131Z","avatar_url":"https://github.com/thingsym.png","language":"PHP","readme":"# WP Theme Boilerplate\n\nNext Generation WordPress Theme Starter Kit\n\n## Features\n\n* Improve template hierarchy and directory layout\n* Implement **WordPress Theme Autoloader**\n* Implement class based theme functions\n* Implement **Theme hooks**\n* Support the Block Editor [Gutenberg](https://github.com/WordPress/gutenberg)\n* Generate your starter theme on **Theme Starter script**\n* Theme development environment on **npm scripts**\n* Theme testing environment on **composer scripts**\n\n## Getting Started\n\n### 1. clone WP Theme Boilerplate with change directory name to Theme Slug\n\n```shell\ngit clone https://github.com/thingsym/wp-theme-boilerplate.git mytheme\n```\n\nor\n\nDownload archive file (zip or tar.gz) form [GitHub Releases page](https://github.com/thingsym/wp-theme-boilerplate/releases)\n\nNote: Change folder name to Theme Slug\n\n### 2. run Theme Starter script with passing Theme name\n\nNote: Run only once.\nNote: Theme name does case-sensitive.\n\n```shell\ncd mytheme\n\nbash bin/setup.sh --theme 'Mytheme'\n```\n\nor (via npm)\n\n```shell\nnpm run setup -- --theme 'Mytheme'\n```\n\n### 3. delete `bin/setup.sh`\n\n### 4. update the theme header in `style.css`\n\n### 5. update or delete `README.md`\n\n### 6. create Git repository and first commit\n\n```shell\ngit init\ngit add .\ngit commit -m \"initial commit\"\n```\n\n### 7. build Theme development environment\n\n```shell\nnpm install\n```\n\n### 8. make your WordPress theme\n\n### 9. Good luck\n\n## Requirements\n\n* [WordPress](https://wordpress.org/) 5.0+\n* [PHP](https://www.php.net/) 5.6+\n* [Node.js](https://nodejs.org/)\n* [npm](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com/)\n* [Composer](https://getcomposer.org/)\n\n### Optional requirements\n\n* [WordPress i18n tools](http://codex.wordpress.org/I18n_for_WordPress_Developers)\n* [gettext](https://www.gnu.org/software/gettext/)\n* [PHPUnit](https://phpunit.de)\n* [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)\n* [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards)\n* [PHPStan](https://github.com/phpstan/phpstan)\n* [PHPMD](https://phpmd.org/)\n\n## Directory Layout\n\n```console\n|- bin/                           # scripts\n|    |- setup.sh                  # Theme Starter script\n|    |- install-wp-tests.sh       # install script for WordPress testing environment\n|    |- reset-wp-tests.sh         # reset script for WordPress testing environment\n|    |- uninstall-wp-tests.sh     # uninstall script for WordPress testing environment\n|\n|- css/                     # stylesheet files\n|    |- block-editor-style.css\n|    |- editor-style.css\n|    |- style-rtl.css\n|    |- style.css\n|    |- style.min.css\n|\n|- functions/               # PHP classes and functional php files\n|    |- custom-header/\n|    |- customizer/\n|    |- entry-meta/\n|    |- post-thumbnail/\n|    |- setup/\n|    |- template/\n|    |- theme-hook/\n|    |- autoload.php        # WordPress Theme Autoloader\n|    |- loadup.php\n|\n|- js/                      # Javascript files\n|\n|- languages/               # Translation files\n|\n|- node_modules/            # npm modules\n|\n|- src/                     # assets for development\n|    |- js/               # javascript files\n|    |- scss/               # scss files\n|\n|- templates/               # template files and partial files\n|    |- content/            # content part files\n|    |- page-header/            # page header part files\n|    |- parts/              # partial files\n|    |- sidebar/            # sidebar part files\n|    |- 404.php\n|    |- archive.php\n|    |- index.php\n|    |- page.php\n|    |- search.php\n|    |- single.php\n|\n|- tests/                   # testing suite files\n|    |- js/                 # Javascript testing suite\n|    |- phpunit/            # PHP testing suite\n|\n|- vendor/                  # Composer dependencies\n|\n|- .editorconfig            # Editor config settings\n|- .gitignore               # gitignore config settings\n|- .travis.yml\n|- composer.json            # Composer package file for theme testing and using PHP libraries\n|- functions.php            # WordPress functionality file\n|- index.php                # WordPress file\n|- LICENSE                  # LICENSE file\n|- package.json             # npm package file for theme development\n|- phpcs.ruleset.xml        # PHP_CodeSniffer config settings\n|- phpmd.ruleset.xml        # PHPMD config settings\n|- phpstan.neon             # PHPStan config settings\n|- phpunit.xml              # PHPUnit config settings\n|- README.md                # this file\n|- readme.txt               # theme readme file for your starter theme\n|- screenshot.png           # Screenshot image file\n|- style.css                # main stylesheet file, only theme header\n|- webpack.config.js        # webpack config settings\n```\n\n## Template hierarchical\n\nThe top priority template hierarchy is the `templates` directory.\n\nFor example, the template hierarchy of the top page is as follows:\n\n1. `templates`/front-page.php\n2. front-page.php\n3. `templates`/home.php\n4. home.php\n5. `templates`/index.php\n6. index.php\n\n## Theme hooks\n\nTheme hooks adds an action through the `add_action` function.\n\n```php\nadd_action( 'wp_theme_boilerplate/theme_hook/site/header', [ $this, 'header' ] );\n```\n\nNote: Replace `wp_theme_boilerplate` with `your_theme_slug`\n\n### Site\n\n* `your_theme_slug`/theme_hook/site/header/before\n* `your_theme_slug`/theme_hook/site/header\n* `your_theme_slug`/theme_hook/site/header/after\n* `your_theme_slug`/theme_hook/site/content/before\n* `your_theme_slug`/theme_hook/site/content/after\n* `your_theme_slug`/theme_hook/site/footer/before\n* `your_theme_slug`/theme_hook/site/footer\n* `your_theme_slug`/theme_hook/site/footer/after\n\n### Content\n\n* `your_theme_slug`/theme_hook/content/prepend\n* `your_theme_slug`/theme_hook/content/append\n* `your_theme_slug`/theme_hook/content/index/prepend\n* `your_theme_slug`/theme_hook/content/index/append\n* `your_theme_slug`/theme_hook/content/page/prepend\n* `your_theme_slug`/theme_hook/content/page/append\n* `your_theme_slug`/theme_hook/content/archive/prepend\n* `your_theme_slug`/theme_hook/content/archive/append\n\n### Entry\n\n* `your_theme_slug`/theme_hook/entry/meta/header\n* `your_theme_slug`/theme_hook/entry/post_thumbnail\n* `your_theme_slug`/theme_hook/entry/meta/footer\n\n## Theme Starter script\n\nTheme Starter script generate your starter theme.\n\nNote: Run only once.\n\n```shell\nbin/setup.sh --theme 'Mytheme'\n```\n\n### Via npm\n\n```shell\nnpm run setup -- --theme 'Mytheme'\n```\n\n## Theme development environment\n\n### Build development environment\n\n```shell\nnpm install\n```\n\n### Run npm script\n\n```shell\nnpm run \u003ctask\u003e\n```\n\n### npm scripts task list\n\n* setup\n* makepot\n* msgfmt:ja\n* msgfmt\n* sass:style\n* sass:style:minify\n* sass:block-editor\n* rtlcss:rtl\n* webpack\n* build:css\n* build:js\n* build:i18n\n* build\n* lint:css\n* lint:scss\n* lint:es\n* lint:\\es:fix\n* lint\n* stats:css\n* bs:server\n* bs:server:watch\n* bs:proxy\n* bs:proxy:watch\n* watch:css\n* watch:js\n* watch\n* server\n* archive:package\n* archive:zip\n* archive\n\n## Theme testing environment\n\n### Build testing environment\n\n```shell\ncomposer install\n```\n\n### Run composer script\n\n```shell\ncomposer run \u003ctask\u003e\n```\n\n### composer scripts task list\n\n* phpcs:config-set\n* phpcs\n* phpcs:warning\n* phpcbf\n* phpmd\n* phpstan\n* phpunit\n* ci\n\n## Resources (Third-party)\n\n* Based on [Underscores](https://underscores.me/), [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html)\n* CSS reset by [normalize.css](https://necolas.github.io/normalize.css/), [MIT](https://opensource.org/licenses/MIT)\n\n## Contribution\n\n### Patches and Bug Fixes\n\nSmall patches and bug reports can be submitted a issue tracker in Github. Forking on Github is another good way. You can send a pull request.\n\n1. Fork [WP Theme Boilerplate](https://github.com/thingsym/wp-theme-boilerplate) from GitHub repository\n2. Create a feature branch: git checkout -b my-new-feature\n3. Commit your changes: git commit -am 'Add some feature'\n4. Push to the branch: git push origin my-new-feature\n5. Create new Pull Request\n\n## Changelog\n\n### [2.1.0] - 2021.01.07\n\n* replace scss from node-sass to dart-sass\n* fix npm scripts for dart-sass\n* add dart-sass\n* update node package\n* add GitHub actions, remove .travis.yml\n\n### [2.0.0] - 2020.08.27\n\n* imporve code with phpcs, phpmd and phpstan\n* update testunit configuration\n* fix composer.json\n\n### [1.9.0] - 2020.08.26\n\n* fix webpack.config.js, generate compressed and uncompressed files\n* fix npm scripts\n* update package.json\n\n### [1.8.0] - 2020.08.10\n\n* update package.json\n* assign object to variable for child theme\n* fix hooks priority\n\n### [1.7.0] - 2020.05.14\n\n* replace array() to short array syntax []\n\n### [1.6.0] - 2020.04.23\n\n* fix css header\n* fix npm scripts\n* fix setup.sh\n* move test case directory\n* bump up phpunit version 7.x\n* add version number with zip archive\n\n### [1.5.0] - 2020.03.24\n\n* move template parts files to page-header dir\n* add non minified javascript files for theme review\n* change javascript files bundle from webpack to minify\n* move javascript files to src/javascript/main directory\n* exclude node_modules in test scope\n* remove README.md in zip archive\n\n### [1.4.0] - 2019.11.19\n\n* fix Theme Starter script\n* add style-rtl.css\n* update .pot\n* fix Requires at least to 5.0\n* fix header image and logo image size\n* add archive script with npm script\n\n### [1.3.0] - 2019.10.21\n\n* fix test case\n* bundle javascript files\n* add webpack, replace from uglify-es\n* move javascript files to src directory\n* fix error content\n* remove paginated with archive\n\n### [1.2.0] - 2019.09.30\n\n* add Class Editor\n\n### [1.1.2] - 2019.09.19\n\n* fix site-info\n* add editor-style.scss\n\n### [1.1.1] - 2019.07.30\n\n* replace from uglifyjs to uglify-es\n* fix header container\n\n### [1.1.0] - 2019.07.11\n\n* add Composer autoloader\n* add editor-style.css\n* add test case\n\n### [1.0.0] - 2019.05.19\n\n* initial release\n\n## License\n\nLicensed under [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html)\n\n## Author\n\n[thingsym](https://github.com/thingsym)\n\nCopyright (c) 2019-2020 by thingsym\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingsym%2Fwp-theme-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthingsym%2Fwp-theme-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingsym%2Fwp-theme-boilerplate/lists"}