/hybrid-core

Official Hybrid Core WordPress theme framework repository.

Primary LanguagePHPGNU General Public License v2.0GPL-2.0

Hybrid Core: WordPress Theme Framework

Hybrid Core is a framework for developing WordPress themes.

It is a package that simplifies some of the complexities of theme development and helps you write more modern PHP code. Its goal is to provide elegant functions, classes, and interfaces for writing code without having to rebuild everything from scratch for each theme.

Requirements

  • WordPress 4.9.6+.
  • PHP 5.6+ (7.0+ recommended).
  • Composer for managing PHP dependencies.

The framework is coded to work on PHP 5.6+, but only 7.0+ is officially supported.

To ease developers into Composer, version 5.0 is a standalone package with no dependencies. Therefore, theme authors can still drop this directly into their theme and use a custom class autoloader. However, no such guarantee exists for future versions.

Purchase or donate

Hybrid Core is free. However, I ask that you purchase a support membership at Theme Hybrid. Even if you don't need support, every purchase helps fund the development of this project.

Donations to the project are also welcome.

Documentation

The documentation is handled via Hybrid Core's wiki. This is community-contributed documentation that I hope you will add to if you use the framework.

Installation

Use the following command from your preferred command line utility to install the package.

composer require justintadlock/hybrid-core

If bundling this directly in your theme, you'll need to add the following code to your functions.php to autoload the project (and any other dependencies).

if ( file_exists( get_parent_theme_file_path( 'vendor/autoload.php' ) ) ) {
	require_once( get_parent_theme_file_path( 'vendor/autoload.php' ) );
}

Bootstrapping Hybrid Core

Hybrid Core isn't launched until an instance of its Hybrid\Core\Application class is created and booted, which should look something like the following.

// Create a new application.
$themeslug = new \Hybrid\Core\Application();

// Add service providers, bindings, etc.

// Bootstrap the application.
$themeslug->boot();

Check out the officially-supported Mythic starter theme for example code or as a good starting point for your HC-based project.

Copyright and License

This project is licensed under the GNU GPL, version 2 or later.

2008 – 2019 © Justin Tadlock.