, (*1)
Bridge is a WordPress starter theme with a modern development workflow., (*2)
Features
- Sass for stylesheets
- Modern JavaScript
- [Gulp]
- [Twig] as a templating engine
-
Bridge MVC for passing data to handle custom functions
- CSS framework: Bootstrap 4
See a working example at https://demo.wpextra.co/bridge., (*3)
Requirements
Make sure all dependencies have been installed before moving on:, (*4)
Theme installation
Install Sage using Composer from your WordPress themes directory (replace your-theme-name
below with the name of your theme):, (*5)
# @ app/themes/ or wp-content/themes/
$ composer create-project wpextra/bridge your-theme-name
To install the latest development version of Sage, add dev-master
to the end of the command:, (*6)
$ composer create-project wpextra/bridge your-theme-name dev-master
During theme installation you will have options to update style.css
theme headers, select a CSS framework, and configure Browsersync., (*7)
Theme structure
themes/your-theme-name/ # โ Root of your Sage based theme
โโโ app/ # โ Theme PHP
โ โโโ apis/ # โ Controller files
โ โโโ controllers/ # โ Controller files
โ โโโ models/ # โ Controller files
โ โโโ repository/ # โ Controller files
โ โโโ persistent/ # โ Controller files
โ โโโ elements/ # โ Your element block
โ โ โโโ blocks/ # โ
โ โ โโโ header/ # โ
โ โ โโโ footer/ # โ
โ โ โโโ popups/ # โ
โ โโโ config.php # โ Theme customizer setup
โ โโโ filters.php # โ Theme filters
โ โโโ helpers.php # โ Helper functions
โ โโโ kernel.php # โ Helper functions
โ โโโ setup.php # โ Theme setup
โโโ composer.json # โ Autoloading for `app/` files
โโโ composer.lock # โ Composer lock file (never edit)
โโโ dist/ # โ Built theme assets (never edit)
โโโ node_modules/ # โ Node.js packages (never edit)
โโโ package.json # โ Node.js dependencies and scripts
โโโ resources/ # โ Theme assets and templates
โ โโโ assets/ # โ Front-end assets
โ โ โโโ config.json # โ Settings for compiled assets
โ โ โโโ fonts/ # โ Theme fonts
โ โ โโโ images/ # โ Theme images
โ โ โโโ scripts/ # โ Theme JS
โ โ โโโ scss/ # โ Theme stylesheets
โ โโโ functions.php # โ Composer autoloader, theme includes
โ โโโ index.php # โ Never manually edit
โ โโโ screenshot.png # โ Theme screenshot for WP admin
โ โโโ style.css # โ Theme meta information
โ โโโ views/ # โ Theme templates
โ โโโ layouts/ # โ Base templates
โ โโโ partials/ # โ Partial templates
โโโ index.php # โ
โโโ archive.php # โ
โโโ page.php # โ
โโโ single.php # โ
โโโ 404.php # โ
โโโ functions.php # โ
โโโ style.scss # โ
โโโ vendor/ # โ Composer packages (never edit)
Theme setup
Edit app/setup.php
to enable or disable theme features, setup navigation menus, post thumbnail sizes, and sidebars., (*8)
Theme development
- Run
yarn
from the theme directory to install dependencies
- Update
resources/assets/config.json
settings:
Build commands
-
yarn start
โ Compile assets when file changes are made, start Browsersync session
-
yarn build
โ Compile and optimize the files in your assets directory
-
yarn build:production
โ Compile assets for production
Documentation
Contributing
Contributions are welcome from everyone., (*9)
Help support our open-source development efforts by :, (*10)
Keep track of development and community news., (*11)