PHPackages                             tjm/wpthemehelper - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tjm/wpthemehelper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tjm/wpthemehelper
=================

Helper classes for WordPress theme development

v1.1.2(1y ago)06910BSDPHPPHP &gt;=5.3.3

Since Aug 17Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/tobymackenzie/wp-theme-helper)[ Packagist](https://packagist.org/packages/tjm/wpthemehelper)[ RSS](/packages/tjm-wpthemehelper/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (5)Used By (1)

WP Theme Helper
===============

[](#wp-theme-helper)

A set of helper classes for WordPress theme development. Provides helpers for theme settings, rendering files, handling paths, and creating shortcodes, among other things.

Useage
------

[](#useage)

This project consists of multiple classes that each provide a set of functionality. They can be used independently, or a WPThemeHelper object can be used as a manager for them. These are the classes

### SettingHelper

[](#settinghelper)

Use this object to manage WordPress theme settings, providing a simple interface to set all basic theme settings through a single interface without needing to use the various different methods needed to set them in WordPress. If set initially, it will also run them at the correct point in the WordPress initialization cycle.

Example:

```
$settingsHelper = new TJM\WPThemeHelper\SettingHelper(Array(
	'settings'=> Array(
		'automatic-feed-links'=> true
		,'custom-header'=> Array(
			'default-image'=> ''
			,'default-text-color'=> '000000'
			,'flex-height'=> true
			,'flex-width'=> true
			,'height'=> 250
			,'max-width'=> 2000
			,'random-default'=> false
			,'width'=> 960
		)
		,'nav-menus'=> Array(
			'footer'=> 'Footer'
			,'header'=> 'Header'
		)
		,'post-thumbnail-size'=> Array(625, 9999)
		,'widget-areas'=> Array(
			Array(
				'name'=> 'Aside 1'
				,'id'=> 'aside-1'
				,'before_widget'=> ''
				,'after_widget'=> ''
				,'before_title'=> ''
				,'after_title'=> ''
			)
			,Array(
				'name'=> 'Aside 2'
				,'id'=> 'aside-2'
				,'before_widget'=> ''
				,'after_widget'=> ''
				,'before_title'=> ''
				,'after_title'=> ''
			)
		)
	)
));
```

By default, the settings override the defaults of the helper.

### Renderer

[](#renderer)

Uses my [Buffer Manager](https://github.com/tobymackenzie/PHP-BufferManager) to render template files and pass data to them.

Example:

```
$renderer = new TJM\WPThemeHelper\Renderer();
echo $renderer->render('aboutBox.php', Array(
	'name'=> 'Toby Mackenzie'
	,'description'=> 'Ohio web developer'
));
```

```
// {theme}/aboutBox.php

```

If using a child theme, it will use the PathHelper to check both the child and parent theme for the file. There is a `renderPiece()` method that runs `render()` for files in a 'pieces' folder.

### PathHelper

[](#pathhelper)

Has a `getThemeFilePath($name, $container, $extension)` method that gets the path to a theme file, with child theme files overriding parent theme files. `$name` is the file name, `$container` is an optional folder path the file is in, and `$extension` is an optional extension to add to the file name.

### ShortcodeHelper

[](#shortcodehelper)

Simple helper for adding shortcodes. You can add a single shortcode at a time, like:

```
$shortcodeHelper = new TJM\WPThemeHelper\ShortcodeHelper();
$shortcodeHelper->add('hello', function($attributes, $content=null){ return "Hello {$content}"; });
```

Or pass an array with multiple shortcodes:

```
$shortcodeHelper->add(Array(
	'goodbye'=> function($attributes, $content=null){ return "Goodbye {$content}"; }
	,'wrap'=> function($attributes, $content=null){
		$elm = (isset($attributes['element'])) ? $attributes['element'] : 'div';
		return "{$content}"
	}
));
```

Also has a `get($codes)` method to get the callables of one or more shortcodes if you want to use them elsewhere.

### DataHelper

[](#datahelper)

A simple class for storing data for later access, with `get($key)`, `set($key, $value)`, and `has($key)` methods.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance54

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~734 days

Total

4

Last Release

622d ago

### Community

Maintainers

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

---

Top Contributors

[![tobymackenzie](https://avatars.githubusercontent.com/u/731711?v=4)](https://github.com/tobymackenzie "tobymackenzie (46 commits)")

### Embed Badge

![Health badge](/badges/tjm-wpthemehelper/health.svg)

```
[![Health](https://phpackages.com/badges/tjm-wpthemehelper/health.svg)](https://phpackages.com/packages/tjm-wpthemehelper)
```

###  Alternatives

[lionix/seo-manager

SEO Manager for Laravel Framework

2165.4k](/packages/lionix-seo-manager)

PHPackages © 2026

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