/MyWPStarterTheme

My WordPress theme starter humbly light, complete, clear and secure

Primary LanguagePHPMozilla Public License 2.0MPL-2.0

MyWPStarterTheme

 

Introduction

My WordPress theme starter humbly light, complete, compatible and more secure as possible.

I follow BEM soon as possible accros the project (folder/file name, HTML/CSS class & id).

The goal is that the theme works in a regressive way. In any case the user can navigate normally in all conditions on all browsers (up to 2 versions back ≃ ie 10)

 

Includes

This project is base on underscores alias _s on GitHub, made by Automattic.

This project include my own gulp file adapted for WordPress theme developement.

 

Usage

All you need to edit is in _src/ folder.

Commandes

npx gulp

When developing, use browser sync to speed up your productivity. It'll compile the scss, prefixes it, quickly optimize images, minify scripts and copy PHP files to the good folder.

npx gulp build

Optimize your project before upload it ! It'll compile the scss, prefixes it, better optimize images (with an acceptable lossy compression), minify scripts and copy PHP files to the good folder.

npx gulp clean

For any reason you what to clean-up the project by delete build files. It will clear caching and delete all build files to just keep essential files and sources.

I prefer to use package locally so I use npx to execute gulp. If you prefer to call gulp directly, install it globally : npm i -g gulp

 

Installation

  1. After duplicate the project use refactor fonction to change MyWPStarterTheme and mywpstartertheme in all files to change the name of your theme.
    ⚠ Be careful to respect the case and keep mentions of MyWPStarterTheme in README & in style.scss (like License URI)⚠
  2. Edit _src/sass/style.scss first comment to change theme informations.
  3. Change the 'screenshot.png' image.
  4. Configure browserSync:
    Edit the file gulpfile.js at the root of the projet at lines 15 and 16 to setup the link and the port to use by browserSync like below.
const browserLink = "http://localhost/";
const browserPort = 3030;

Please refer to readme file of MyGulpFile project if you need to change gulp configuration

  1. Update node_modules with npm i
  2. You're done

 

Project architecture

I use my own project architecture to be able to separate source code and compile one.

πŸ“¦MyWPStarterTheme
 ┣ πŸ“‚_src
 ┃  ┣ πŸ“‚assets
 ┃  ┃  ┃
 ┃  ┃  ┣ πŸ“‚fonts
 ┃  ┃  ┃  β”— πŸ“‚fontFolder '> Here there are all the fonts are in their own folder'
 ┃  ┃  ┃
 ┃  ┃  β”— πŸ“‚imgs
 ┃  ┃     ┣ πŸ“‚matrix
 ┃  ┃     ┃  ┣ πŸ“‚icons
 ┃  ┃     ┃  ┃  β”— πŸ“œ '> here there are all matrix icons alternatives'
 ┃  ┃     ┃  ┃
 ┃  ┃     ┃  ┣ πŸ“‚illustrations
 ┃  ┃     ┃  ┃  β”— πŸ“œ '> here there are all matrix illustrations alternatives'
 ┃  ┃     ┃  ┃
 ┃  ┃     ┃  β”— πŸ“‚pictures
 ┃  ┃     ┃     β”— πŸ“œ '> here there are all matrix pictures'
 ┃  ┃     ┃
 ┃  ┃     β”— πŸ“‚vector
 ┃  ┃        ┣ πŸ“‚icons-vector
 ┃  ┃        ┃  β”— πŸ“œ '> here there are all vector icons alternatives'
 ┃  ┃        ┃
 ┃  ┃        β”— πŸ“‚illustrations-vector
 ┃  ┃           β”— πŸ“œ '> here there are all vector illustrations alternatives'
 ┃  ┃
 ┃  ┣ πŸ“‚js
 ┃  ┃  ┣ πŸ“‚modules-scripts
 ┃  ┃  ┃  β”— πŸ“œ '> here there are all scripts use multiple times over the theme'
 ┃  ┃  ┃
 ┃  ┃  β”— πŸ“‚pages-scripts
 ┃  ┃     β”— πŸ“‚pageFolder '> here there are all scripts use only one times for on specific page groupes by pages in directory'
 ┃  ┃
 ┃  ┣ πŸ“‚php
 ┃  ┃  ┣ πŸ“‚inc
 ┃  ┃  ┃  β”— πŸ“‚template-parts
 ┃  ┃  ┃     β”— πŸ“œ '> here there are all template-parts WP theme'
 ┃  ┃  ┃
 ┃  ┃  ┣ πŸ“‚modules-php
 ┃  ┃  ┃  β”— πŸ“œ '> here there are all PHP code use multiple times over the theme'
 ┃  ┃  ┃
 ┃  ┃  ┣ πŸ“‚page_templates
 ┃  ┃  ┃  β”— πŸ“œ '> here there are all page templates for WP theme'
 ┃  ┃  ┃
 ┃  ┃  β”— πŸ“œ '> here there are all standard WP pages, like index.php'
 ┃  ┃
 ┃  β”— πŸ“‚sass
 ┃     ┣ πŸ“‚backoffice-style
 ┃     ┃  β”— πŸ“œ '> here there are all style for backoffice (compiled in admin.css style sheet)'
 ┃     ┃
 ┃     ┣ πŸ“‚elements-style
 ┃     ┃  β”— πŸ“œ '> here there are all style applied on "elements" use multiple time over the theme, like footer / links etc...'
 ┃     ┃
 ┃     ┣ πŸ“‚modules-style
 ┃     ┃  β”— πŸ“œ '> here there are all style used to implement fonctionnalitied, like accessibility or normalize'
 ┃     ┃
 ┃     ┣ πŸ“‚templates-style
 ┃     ┃  β”— πŸ“œ '> here there are all style sheet for each page, use for specific style on only one page'
 ┃     ┃
 ┃     ┣ πŸ“‚variables-style
 ┃     ┃  β”— πŸ“œ '> here there are all SASS variables, like colors'
 ┃     ┃
 ┃     ┣ πŸ“œadmin.scss '> this file is import all necessary for style backoffice of WP'
 ┃     β”— πŸ“œstyle.scss '> this file import all necessary style'
 ┃
 ┣ πŸ“œ .gitattributes
 ┣ πŸ“œ .gitignore
 ┣ πŸ“œ CHANGELOG.md
 ┣ πŸ“œ gulpfile.js '> this file comes with [my own gulp file](https://github.com/MrZyr0/MyGulpFile)'
 ┣ πŸ“œ LICENSE.md
 ┣ πŸ“œ NOTICE.md
 ┣ πŸ“œ package-lock.json '> this file comes with [my own gulp file](https://github.com/MrZyr0/MyGulpFile)'
 ┣ πŸ“œ package.json '> this file comes with [my own gulp file](https://github.com/MrZyr0/MyGulpFile)'
 ┣ πŸ“œ README.md
 β”— πŸ“œ screenshot.png '> this file is the screenshot used by WP on theme selection'

 

Roadmap

Please check [Unreleased] tag in changelog to read what's next.

 

Cool tools

In addition to the theme here are some interesting tools and/or that I use.
I have benchmarked many plugins to make this list. When there's only one plugin for a feature, it's because I've determined that it's the best (the most powerful, the most practical, the lightest).

Content

Development

Security

Search Engine Optimization (SEO)

Performance optimizations

Tools

Need testing

Here is mutiple plugins & tools, that could be implemented, for one usage that I need to test to determine the most interesting one.

 

Technology Watch

Here are some interesting sources and documentations that can help or inspire for web development (WP, accessibility, compatibility, best practices, etc.).

Repositories

Tutorials / Articles

Blogs

Tools / Documentation / Learning

Books

Legal informations

Other