A Wordpress Boilerplate
Anchor is a Wordpress theme boilerplate made to simplify your theme creation workflow. It uses Anchor-Framework as a dependency so that it can be updated for existing projects.
You have to get composer and node to start.
- Composer is used to load theme dependencies
- Node is required to compile assets
To create a new project go into your CLI (Terminal, Powershell, etc) and type
composer create-project your_project_name cd your_project_name npm install
To compile your assets type
Blade support for templating
- Vue.JS support
- React support
- Compilation for Gutenberg blocks
LESS, SCSS, SASS and CSS packaging
- Image minification
- IconFont creation
- Possibility to add custom dashicons
Auto includes for PHP files
Anchor (from Anchor framework) supports Blade templating language as a replacement for Wordpress PHP file structure. The Blade file structure use the exact same hierarchy as Wordpress does (https://wphierarchy.com/) with 2 exceptions
- Anchor will fetch app/views and subfolder with no fetch limitation (whereas Wordpress only look 1 level ahead)
- Anchor will consider posttype/single.blade.php as a replacement for /single-posttype.blade.php and posttype/archive.blade.php /archive-posttype.blade.php for a cleaner folder structure
The current version of Blade is 5.
Stylesheet assets are compiled with Gulp (https://gulpjs.com). Use the css compiler you want for styling. We support LESS, SASS or plain old CSS.
The Gulp file will compile main.scss, main.css, and main.less into a single file main.css file which will be enqueued into the frontend part of your site.
It will also take any admin.css, admin.scss and admin.less and compile them into a single admin.css file which will be enqueued into the backend part of your site.
|/app/||Where the magic happens|
|/components/||Place to pub your Gutenberg components|
|/public/||Compilation target for css, icons, blade templates etc.|
|functions.php||Default wordpress function file that gets rewriten by Gulp|
|index.php||Default wordpress index file|
|style.css||Default wordpress style file|