Giter VIP home page Giter VIP logo

components's Introduction

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

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

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

// Get config path.
$config = dirname( dirname( __DIR__ ) ) . '/config';

// Setup theme.
\SeoThemes\Core\Theme::setup( $config );

Loading Components

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.

Structure

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

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.

components's People

Contributors

seothemes avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.