axio-starter
Axio Starter (previously Aucor Starter)
đź–Ą For developer from developers:
Superior Gutenberg WordPress starter theme with modern build tools by Generaxion. 250+ hours of development over 6 years to make the greatest starting point for WordPress site.
Demo: axio.generax.io
🔌 Required plugins:
- Axio Core: Core functionality that is clever to be centrally updated.
- Advanced Custom Fields Pro: Some custom blocks use ACF. You can do without, but should remove them.
🏷 Buzz-words:
Gutenberg, Gulp, Yarn, SVG, SASS, Browsersync, a11y, l18n, Advanced Custom Fields, Polylang, Schema.org, Native lazyload, BEM, Babel, Responsive images
Table of contents
1. Directory structure
Directory
Contents
/acf-json/
automatically saved JSON versions of site specific fields from Advanced Custom Fields
/assets/
global JS, SASS, images, SVG and fonts
/bin/
shell scripts for bulk tasks/automations
/dist/
has processed, combined and optimized assets ready to be included to theme
/modules/
features that are packaged into modules like blocks, template parts, post-types
/inc/
global php files that are not part of template structure/modules
2. Setup
2.1 New site setup
Do these theme installation steps before modifying anything.
Download & Extract
- Download this repository
-
Extract into /wp-content/themes/ and rename for project like
sitename
Run setup
Run setup wizard in theme root with bash sh bin/setup.sh
Field
Meaning
Default
Site name
Name in style.css
Axio by Generaxion
Local development url
Browsersync’s mirror URL. Stored at /assets/manifest.js
https://axio-starter.local
Author name
Author in style.css
Generaxion
Author URL
Author URL in style.css
https://www.generaxion.com
Run localizator (if needed)
Theme strings are by default in English but we do support Finnish and probably Swedish in near future. If you would like to initialize strings in these languages, do the following:
-
Run
bin/localizator.sh
- Input language code
- Select to remove language packages after running
Install Axio Core
Some of the functionality of Axio by Generaxion require plugin Axio Core. The plugin is centrally updated so that sites using starter will be easier to maintain and there will be less duplicate code from project to project. Axio by Generaxion won’t have fatal errors without it, but for example localization won’t work without it.
Download Axio Core from WordPress.org or Github and activate.
Protip: If you are using composer: composer require wpackagist-plugin/axio-core
or WP-CLI: wp plugin install axio-core
.
First 15 minutes of your new site
Here’s optional next steps:
-
Go through the
/modules/
and remove any unneeded. Just throw them to trash. -
Save logo at
/assets/images/logo.svg
-
Setup colors and fonts at
/assets/styles/utils/_variables.scss
2.2 Developer setup
Every developer does this before first time working with the project.
-
Open terminal and navigate to
/wp-content/themes/sitename
-
Run
yarn install
(fetches all node packages for build tools).
Protip: If you don’t have Gulp installed locally run npm install --global gulp-cli
. If you are missing Yarn, install Yarn.
2.3 Work session setup
Do this everythime you start to work with the theme.
-
Open terminal and navigate to
/wp-content/themes/sitename
-
Run
gulp watch
to activate build process in background. You’ll get development proxy at http://localhost:3000 where changes to code will be updated automatically to browser (no need to reload). -
To quit press
ctrl
+c
Protip: You can also run just gulp
to build all the resources or just some resources with gulp styles
or gulp scripts
. Want to start the watch task but not open the Browsersync in browser? Start watch with quiet mode qulp watch -q
.
3. Components
Components are the first unique building blocks of this theme. They are an evolution of WordPress’s get_template_part()
function that aim to fix underlying issues of that function:
- Arguments: Template parts had no legitimate way to pass arguments (until WP 5.5.0).
- Returning and echoing: All components can be either echoed or HTML markup can be returned.
- Validation: Template part concept won’t encourage to validate arguments early and end up with highly nested if checks for the code. In components you can exit early and have separated backend and frontend functions to gather and sanitize data.
- Context free:…