A config-based composer package that provides a set of modules to extend Genesis child theme development.
This library contains all of the core logic for our config-driven WordPress themes, such as the Genesis Starter Theme.
It contains two key classes:
Component
to be extended to build other components, and:Theme
which is responsible for instantiating components and injecting the correct configuration.
The main purpose of this library is to provide a shareable codebase for commercial Genesis child themes. This is achieved by using configuration-based architecture to separate the theme's reusable logic from it's configuration. Using this approach, we are able to use a single codebase which can be heavily customized by passing in different configs. This project is inspired by the Genesis Theme Toolkit by Gary Jones and D2 Core by Craig Simpson, but contains additional functionality specific to commercial themes, including support for older versions of PHP.
Requirement | How to Check | How to Install |
---|---|---|
PHP >= 5.4 | php -v |
php.net |
WordPress >= 4.8 | Admin Footer |
wordpress.org |
Genesis >= 2.6 | Theme Page |
studiopress.com |
Composer >= 1.5.0 | composer --version |
getcomposer.org |
Node >= 9.10.1 | node -v |
nodejs.org |
NPM >= 5.6.0 | npm -v |
npm.js |
Yarn >= 0.2.x | yarn -v |
yarnpkg.com |
Gulp CLI >= 1.3.0 | gulp -v |
gulp.js |
Gulp = 3.9.1 | gulp -v |
gulp.js |
Include the package in your child theme's composer.json
file (an example composer.json
file can be found here).
composer require seothemes/core
Optionally install the TGMPA composer package:
composer require tgmpa/tgm-plugin-activation
Components should be loaded in your theme functions.php
file, using the Theme::setup
static method. Code should run on the after_setup_theme
hook (or genesis_setup
if you use Genesis Framework).
// Get config path.
$config = dirname( dirname( __DIR__ ) ) . '/config';
// Setup theme.
\SeoThemes\Core\Theme::setup( $config );
Components are automatically loaded if a config file matching the component name in kebab case is found. For example, to load the GoogleFonts component, create a file in the config
directory called google-fonts.php
.
Core follows the PHP Package Development Standard folder structure and uses PSR-4 Autoloading.
./
├── src/
│ ├── Breadcrumb.php
│ ├── Component.php
│ ├── Enqueue.php
│ ├── GenesisSettings.php
│ ├── GoogleFonts.php
│ ├── ImageSizes.php
│ ├── Kirki.php
│ ├── Merlin.php
│ ├── PageLayouts.php
│ ├── PostTypeSupport.php
│ ├── SimpleSocialIcons.php
│ ├── Tgmpa.php
│ ├── Theme.php
│ ├── ThemeSupport.php
│ ├── Updater.php
│ └── WidgetAreas.php
├── .gitignore
├── composer.json
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE.md
└── README.md
Please visit https://github.com/seothemes/core/issues/ to open a new issue.
This project is licensed under the GNU General Public License - see the LICENSE.md file for details.