seothemes/core

A config-based composer package that provides a set of modules to extend Genesis child theme development.

0.3.1 2018-11-08 11:55

Core

[WordPress]() License

A config-based composer package that provides a set of modules to extend Genesis child theme development.

Description

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.

Requirements

RequirementHow to CheckHow to Install
PHP >= 5.4php -vphp.net
WordPress >= 4.8Admin Footerwordpress.org
Genesis >= 2.6Theme Pagestudiopress.com
Composer >= 1.5.0composer --versiongetcomposer.org
Node >= 9.10.1node -vnodejs.org
NPM >= 5.6.0npm -vnpm.js
Yarn >= 0.2.xyarn -vyarnpkg.com
Gulp CLI >= 1.3.0gulp -vgulp.js
Gulp = 3.9.1gulp -vgulp.js

Installation

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

Usage

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).

add_action( 'genesis_setup', __NAMESPACE__ . '\\child_theme_setup', 15 );
/**
 * Child theme setup.
 *
 * Hooking to `genesis_setup` means we don't have to "start the engine"
 * by requiring the Genesis `lib/init.php` file, and it provides us
 * with access to all of Genesis functions once it's been loaded.
 *
 * @since 1.0.0
 *
 * @return void
 */
function child_theme_setup() {
    $vendor = require_once __DIR__ . '/vendor/autoload.php';
    $config = require_once __DIR__ . '/config/defaults.php';
    Theme::setup( $config );
}

Structure

Core follows the PHP Package Development Standard folder structure and uses PSR-4 Autoloading.

./
├── src/
│   ├── AssetLoader.php
│   ├── Breadcrumbs.php
│   ├── Component.php
│   ├── Constants.php
│   ├── Customizer.php
│   ├── CustomColors.php
│   ├── DemoImport.php
│   ├── GenesisSettings.php
│   ├── GoogleFonts.php
│   ├── HeroSection.php
│   ├── Hooks.php
│   ├── ImageSizes.php
│   ├── Kirki.php
│   ├── PageLayouts.php
│   ├── PageTemplate.php
│   ├── PostTypeSupport.php
│   ├── PluginActivation.php
│   ├── SimpleSocialIcons.php
│   ├── TextDomain.php
│   ├── Theme.php
│   ├── ThemeSupport.php
│   ├── WidgetArea.php
│   └── Widgets.php
├── .gitignore
├── composer.json
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE.md
└── README.md

Support

Please visit https://github.com/seothemes/core/issues/ to open a new issue.

License

This project is licensed under the GNU General Public License - see the LICENSE.md file for details.

Authors

SEO Themes logo   D2 Themes logo

See also the list of contributors who participated in this project.

Special Thanks

Craig Simpson, Gary Jones