PHPackages                             gamajo/theme-toolkit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. gamajo/theme-toolkit

AbandonedArchivedLibrary[Framework](/categories/framework)

gamajo/theme-toolkit
====================

Building blocks for developing a config-based WordPress theme.

0.6.0(8y ago)717211MITPHPPHP ^7.1CI failing

Since Jun 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/gamajo/theme-toolkit)[ Packagist](https://packagist.org/packages/gamajo/theme-toolkit)[ RSS](/packages/gamajo-theme-toolkit/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (8)Versions (7)Used By (1)

Theme Toolkit
=============

[](#theme-toolkit)

Building blocks to develop a config-based WordPress theme.

When building a theme, wouldn't it be nice to separate out the implementation-specific config, from the reusable logic? This is the premise upon which the [Using a Config to Write Reusable Code](https://www.alainschlesser.com/config-files-for-reusable-code/) series articles are written, and which this package enables.

It uses the [BrightNucleus\\Config](https://github.com/brightnucleus/config) package for managing the configuration objects, while the classes in this package consumes them to provide an easy way to:

- Register and enqueue Google Fonts.
- Add and remove image sizes.
- Unset (inherited) page templates.
- Add theme support.
- Register and unregister widget areas (sidebars).
- Register and unregister widgets.
- Manage script and style dependencies.

Installation
------------

[](#installation)

Requires PHP 7.1.

In a terminal, browse to the directory with your theme in and then:

```
composer require gamajo/theme-toolkit
```

You can then autoload (PSR-4) or require the files as needed.

Usage
-----

[](#usage)

See the [example-config.php](docs/example-config.php). This would typically live in your theme, at `config/defaults.php`.

Your theme would then contain a function, in the `functions.php`, to pull in this config, and load up the individual components, which are referred to as *bricks*:

```
// functions.php

namespace Gamajo\ExampleTheme;

use BrightNucleus\Config\ConfigFactory;
use Gamajo\ThemeToolkit\Dependencies;
use Gamajo\ThemeToolkit\GoogleFonts;
use Gamajo\ThemeToolkit\ImageSizes;
use Gamajo\ThemeToolkit\Templates;
use Gamajo\ThemeToolkit\ThemeSupport;
use Gamajo\ThemeToolkit\Widgets;
use Gamajo\ThemeToolkit\WidgetAreas;
use Gamajo\ThemeToolkit\ThemeToolkit;

defined( 'ABSPATH' ) || exit;

if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
	require __DIR__ . '/vendor/autoload.php';
}

add_action( 'after_setup_theme', __NAMESPACE__ . '\setup' );
/**
 * Theme setup.
 *
 * Compose the theme toolkit bricks.
 */
function setup() {
	$config_file = __DIR__ . '/config/defaults.php';
	$config = ConfigFactory::createSubConfig( $config_file, 'Gamajo\ExampleTheme' );

	// These bricks are run in admin and front-end.
	$bricks = [
		Dependencies::class,
		ImageSizes::class,
		Templates::class,
		ThemeSupport::class,
		Widgets::class,
		WidgetAreas::class,
	];

	// Apply logic in bricks, with configuration defined in config/defaults.php.
	ThemeToolkit::applyBricks($config, ...$bricks);

	if ( ! is_admin() ) {
		// Only front-end bricks.
		$bricks = [
			GoogleFonts::class,
		];

		ThemeToolkit::applyBricks($config, ...$bricks);

	}
}
```

The `'Gamajo\ExampleTheme'` string matches the two keys in the `return` at the bottom of the config file. Change this in the config and the function to be your company name and theme name.

You don't have to use all of the bricks in this package; pick and choose.

You can add your own bricks to your theme (in your `src/` or similar directory), and then make use of them in the function above.

For Genesis Framework users, see the [Genesis Theme Toolkit](https://github.com/gamajo/genesis-theme-toolkit) which has extra bricks for registering layouts, breadcrumbs args etc.

Change Log
----------

[](#change-log)

Please see [CHANGELOG.md](CHANGELOG.md).

Credits
-------

[](#credits)

Built by [Gary Jones](https://twitter.com/GaryJ)
Copyright 2017 [Gamajo](https://gamajo.com)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

6

Last Release

3256d ago

PHP version history (2 changes)0.1.0PHP ^7.0

0.6.0PHP ^7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/ba7751eebec0f74a4963e9a062f49e58222b97872bf193d95f0505f3df321d09?d=identicon)[GaryJones](/maintainers/GaryJones)

---

Top Contributors

[![GaryJones](https://avatars.githubusercontent.com/u/88371?v=4)](https://github.com/GaryJones "GaryJones (25 commits)")[![89gsc](https://avatars.githubusercontent.com/u/1032459?v=4)](https://github.com/89gsc "89gsc (4 commits)")[![craigsimps](https://avatars.githubusercontent.com/u/11818429?v=4)](https://github.com/craigsimps "craigsimps (4 commits)")

---

Tags

theme-toolkitwordpresswordpress-theme-developmentwordpresswordpress-theme-development

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/gamajo-theme-toolkit/health.svg)

```
[![Health](https://phpackages.com/badges/gamajo-theme-toolkit/health.svg)](https://phpackages.com/packages/gamajo-theme-toolkit)
```

###  Alternatives

[roots/wordpress

WordPress is open source software you can use to create a beautiful website, blog, or app.

19317.6M301](/packages/roots-wordpress)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k16.2k47](/packages/elgg-elgg)[themosis/theme

The Themosis framework boilerplate theme.

10349.0k3](/packages/themosis-theme)[alleyinteractive/pest-plugin-wordpress

WordPress Pest Integration

273.9k1](/packages/alleyinteractive-pest-plugin-wordpress)[wpstarter/framework

The WpStarter Framework - Laravel Framework for WordPress

1610.2k5](/packages/wpstarter-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
