Juniper - WordPress starter boilerplate + theme
JuniperTheme is symbiosis of Bedrock boilerplate and Timber.
Bedrock is a modern WordPress stack that helps you get started with the best development tools and project structure. Timber allows you to use twig templating system in your WP project. With this approach you can create theme code with logic files separated from frontend.
- Easy WordPress configuration with environment specific files
- File structure which makes keeping and maintaining your project on a Git a lot easier
- Dependency management with Composer
- Twig templating system
- Bash console scripts to make creating project from the scratch much easier
- PHP >= 7.4
- Composer - Install
- PHPCS & PHPCBF with WordPress-Extra standard installed
- Create local database as you would do for normal WP instance
- Map project main catalogue to domain on your localhost
- Start a new project:
and follow the instructions in the console. Type in details from step 1 and 2. .env file will be crated for you (all DB and site details sits there)
$ bash start.sh
- Fill correct domain details in .htaccess in main catalogue.
- Check if /web/ directory has .htaccess file with default WP entries.
- Run
in main project directory
$ bash work.sh
- Start coding your theme in /web/app/themes/juniper-theme/ :)
To maintain project correctly we insist you to use composer.json in main catalogue.
If you want to add new plugin to your project you can use WPackagist - the only thing you need is plugin slug from the main WP repository.
You can update them with the same easy way by changing version in composer.json.
The main operations that we automate have been handled by below scripts: :
-
start.sh - used for the initial configuration of the project. Through this process, we areable to enter the basic data to the database, define the main URL and ACF key. After providing those information, the installer will generate an .env file, which in our case will contain all configuration data (as in wp-config.php in a vanilla WordPress installation).
-
work.sh - used every time you work on a project. It compiles the styles in real time by calling a parcel script to listen for file changes.
- Adding Custom Post Types - After getting the name, a CPT will be created. Its editing will of course be possible later, because this command will generate a file in the theme directory.
$ wp add cpt --name="Product"
- Adding Taxonomies - Add a name of the taxonomy you want and the slug name of the posts you want it to be attached to and this command will take care of the rest
$ wp add taxonomy --name="Category" --post="product"
- Adding Gutenberg Blocks - This creates a custom Gutenberg block for the user utilizin the ACF Timber Blocks solution which allows us to use one .twig file with the appropriate comment to create a block. Keywords and description fields are optional
$ wp add block --name="Reviews" --keywords="quote,stars" --description="Show three newest reviews"