WordPress starter is a starter template for WordPress websites.
Stack:
Babel,
Browsersync,
Gulp,
minireset.css,
Sass,
Timber,
Webpack,
WordPress,
WP-CLI.
- Prerequisites
- Getting started
- Commands
- Project structure
- Layout structure
- Linting PHP files
- Cache busting
- Authors
- Contributing
- License
Step 1: Run the following command to create a new theme:
make create-theme
The prompt will ask you to enter some informations related to your theme, then to choose the site language. The starter theme is currently available in two languages:
en_US
(selected by default)fr_FR
If the desired language is not in the list, feel free to contribute to the project by adding a language.
Step 2: Run the following command to complete the installation:
make setup
Your WordPress is ready to be customized!
## Run an interactive prompt to create a new theme
make create-theme
## Get everything ready (Docker containers, WordPress download
## and configuration)
make setup
## Serve:
## - WordPress front-office at http://localhost:3000 with live reloading
## - WordPress back-office at http://localhost:3010/wp-admin
## (username: admin, password: password)
## - phpMyAdmin at http://localhost:3011
make
π‘ This command will also install dependencies on first run and when package.json
or yarn.lock
files are updated.
## Build WordPress theme for production use
make build
π‘ This command will also install dependencies on first run and when package.json
or yarn.lock
files are updated.
## List available commands
make help
.
βββ app # WORDPRESS SITE
β βββ wp-content/themes/md-starter # Starter theme
β β βββ fonts # Font assets
β β β βββ roboto # Roboto from Google Fonts (TTF, WOFF, WOFF2)
β β β
β β βββ images # Image assets
β β β βββ og-image.jpg # Image for og:image meta tag (placeholder by default)
β β β
β β βββ languages # Localization
β β β βββ en_US.mo # en_US theme localization (compiled)
β β β βββ en_US.po # en_US theme localization
β β β βββ fr_FR.mo # fr_FR theme localization (compiled)
β β β βββ fr_FR.po # fr_FR theme localization
β β β βββ md-starter.pot # Theme localization template
β β β
β β βββ lib # Theme features
β β β βββ disable_wp_emoji.php # Disabling WordPress emoji
β β β βββ theme.php # Theme declaration and initialization
β β β
β β βββ post-types # Post types
β β β βββ .gitkeep # Tracking an empty directory within Git
β β β
β β βββ templates # Twig templates
β β β βββ components # Components
β β β β βββ nav-footer.twig # Footer nav
β β β β βββ navbar.twig # Navbar (main nav)
β β β β
β β β βββ dev # Development utilities
β β β β βββ lorem.twig # Partial featuring static lorem ipsum content
β β β β
β β β βββ layouts # Layouts
β β β β βββ default.twig # Default layout
β β β β
β β β βββ 404.twig # 404 error
β β β βββ index.twig # Home page
β β β βββ page.twig # Page
β β β βββ single.twig # Single post
β β β
β β βββ 404.php # 404 error declaration
β β βββ composer.json # PHP dependencies, used by Composer
β β βββ composer.lock # Tracking exact versions for PHP dependencies, used by Composer
β β βββ functions.php # Changing WordPress default behavior
β β βββ index.php # Home page declaration
β β βββ page.php # Page declaration
β β βββ screenshot.png # Theme screenshot, used in WordPress back-office
β β βββ single.php # Single post declaration
β β βββ style.css # Theme CSS declaration
β β
β βββ wp-cli.yml # WP-CLI configuration
β
β
βββ bin # BINARIES
β βββ create-theme # Script to create a new theme
β βββ dwp # Script to use WP-CLI inside a Docker container
β
β
βββ documentation-images # PROJECT DOCUMENTATION IMAGES
β
β
βββ gulp # GULP/WEBPACK CONFIGURATION AND TASKS
β βββ env # Gulp configuration per environment
β β βββ dev.js # Development environment
β β βββ prod.js # Production environment
β β
β βββ tasks # Gulp tasks
β β βββ sass.js # Sass task declaration
β β βββ script.js # JavaScript task declaration
β β
β βββ webpack # Webpack configuration per environment
β β βββ common.js # Shared between development and production environments
β β βββ dev.js # Development environment
β β βββ prod.js # Production environment
β β
β βββ index.js # Script to invoke proper environment and dynamically load
β # Gulp tasks
β
β
βββ js # JAVASCRIPT SOURCE FILES
β βββ app.js # Main JavaScript file used as entry by Webpack
β
β
βββ sass # SASS STYLE (STRUCTURE INSPIRED BY BULMA https://bulma.io)
β βββ base # Base style
β β βββ _all.sass # Importing all stylesheets
β β βββ generic.sass # Style for generic elements (html, body, etc.)
β β βββ helpers.sass # Helper classes (modifiers)
β β
β βββ components # Components style
β β βββ _all.sass # Importing all stylesheets
β β
β βββ dev # Development utilities
β β βββ shame.sass # WIP style or dirty hacks
β β βββ structure.sass # Highlighting site structure (import commented by default)
β β
β βββ elements # Elements style
β β βββ _all.sass # Importing all stylesheets
β β βββ content.sass # Handling WYSIWYG generated content
β β βββ title.sass # Title style
β β
β βββ fonts # Fonts style
β β βββ _all.sass # Importing all stylesheets
β β βββ roboto.sass # @font-face style for Roboto
β β
β βββ form # Form style
β β βββ _all.sass # Importing all stylesheets
β β
β βββ grid # Grid style
β β βββ _all.sass # Importing all stylesheets
β β βββ columns.sass # Basic columns system
β β
β βββ layout # Layout style
β β βββ _all.sass # Importing all stylesheets
β β βββ footer.sass # Footer style
β β βββ header.sass # Header style
β β βββ main.sass # Main style
β β βββ section.sass # Section style
β β βββ wrapper.sass # Wrapper style
β β
β βββ utilities # Utilities
β β βββ _all.sass # Importing all stylesheets
β β βββ animations.sass # Some basic animations
β β βββ mixins.sass # A few useful mixins
β β βββ variables.sass # Variables for colors, typography, etc.
β β
β βββ style.sass # Main Sass file used as source by Gulp
β
β
βββ .babelrc # Presets and plugins to use, used by Babel
βββ .gitignore # Files and folders ignored by Git
βββ .tool-versions # Which version to use locally for each language, used by asdf
βββ docker-compose.yml # Services, networks and volumes, used by Docker Compose
βββ Dockerfile # Docker containers declaration
βββ gulpfile.js # Gulp configuration
βββ LICENSE # License
βββ Makefile # Commands for this project
βββ package.json # JavaScript dependencies, used by Yarn
βββ README.md # Project documentation
βββ renovate.json # Renovate bot configuration
βββ yarn.lock # Tracking exact versions for JavaScript dependencies,
# used by Yarn
The starter comes with a simple layout, structured like the following:
// Wrapper
.wrapper
// Header
header.header
.container
β¦
// Main
main.main
// Section (repeatable)
section.section
.container
β¦
// Footer
footer.footer
.container
β¦
There is also a Sass utility allowing to highlight the site structure (pretty useful in development). Simply uncomment @import "dev/structure.sass"
in style.sass
if you want to use it.
Follow these steps if you want to lint PHP files using WordPress Coding Standards.
Step 1: Install wp-coding-standards/wpcs
:
make install-wpcs
Step 2: Move to your theme folder.
Step 3: Set path for wpcs
:
composer config-set
Step 4: You are now able to lint any PHP file:
composer lint [filename].php
Our strategy for cache busting is to automatically append a ?ver=[version]
to each asset query. When you need to bust the cache, simply update Version
in style.css
.
- @Awea - Idea and initial work
- @mmaayylliiss - Design, code/documentation review
Contributions, issues and feature requests are welcome! See the list of contributors who participated in this project.
WordPress starter is licensed under the GNU General Public License v3.0.