Base Theme is a custom basic WordPress theme, which includes foundation basic grid system and some basic customizer settings which are required in almost all projects.
- Simple WordPress single site
- WordPress Multisite (Sub-dir and Sub-domain)
- WordPress-VIP-Go
- WordPress / WordPress VIP-Go coding standards
- PHP autoloader
- Following standard Namespacing
- Assets build using Webpack
- Dynamic POT file generation
.
├── assets # Theme Assets
│ ├── build # Build Assets
│ │ ├── css
│ │ └── js
│ ├── fonts # Custom Fonts
│ │ └── open-sans
│ └── src
│ ├── js
│ └── sass
├── inc
│ ├── classes # Theme main functions
│ │ ├── post-types # Register custom post types
│ │ └── taxonomies # Register custom taxonomies
│ ├── helpers # Helper functions
│ └── traits # Traits
├── languages # Pot file
├── page-templates # Custom page templates
└── template-parts # Template parts
Please make sure you installed below software/packages/tools globally before moving forward,
- Dart Sass - https://sass-lang.com/install
- PHPCS - https://github.com/squizlabs/PHP_CodeSniffer
- WordPress Coding Standards - https://github.com/WordPress/WordPress-Coding-Standards
- VIP Coding Standard (for WP VIP project only) - https://github.com/Automattic/VIP-Coding-Standards
- PHPCompatibilityWP - https://github.com/PHPCompatibility/PHPCompatibilityWP
After cloning repo run following command,
npm install
# if throw error in terminal, try below command
npm install --legacy-peer-deps
- https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/
- https://developer.wordpress.org/themes/advanced-topics/theme-json/
npm run dev # During development
npm run prod # Generate production ready minified assets
# Generate pot files
npm run pot
# Lint CSS, JS and PHP
npm run lint:css
npm run lint:js
Check the code quality for the current theme.
Run following command from theme directory wp-content/themes/base-theme/
# Test with default phpcs.xml file config
phpcs --standard=phpcs.xml ./
# Test against VIP Coding Standard
phpcs -d memory_limit=1024M --standard=WordPress-VIP-Go,WordPressVIPMinimum -s --ignore=vendor,node_modules,tests,apigen,predis,build ./
Cheers! 👍