PHPackages                             bigboxwc/wp-template-loader - 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. [Templating &amp; Views](/categories/templating)
4. /
5. bigboxwc/wp-template-loader

ActiveLibrary[Templating &amp; Views](/categories/templating)

bigboxwc/wp-template-loader
===========================

WordPress view/template loading helpers.

1.0.2(8y ago)1264GPL-2.0-or-laterPHP

Since Jun 15Pushed 8y ago1 watchersCompare

[ Source](https://github.com/bigboxwc/wp-template-loader)[ Packagist](https://packagist.org/packages/bigboxwc/wp-template-loader)[ RSS](/packages/bigboxwc-wp-template-loader/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

BigBox Template Loader Component
================================

[](#bigbox-template-loader-component)

Add sanity to WordPress templating systems.

Table Of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Basic Usage](#basic-usage)
- [Contributing](#contributing)

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

[](#installation)

The best way to use this component is through Composer:

```
composer require bigboxwc/wp-template-loader
```

Basic Usage
-----------

[](#basic-usage)

Initializing the core template filtering should happen during runtime. This will route WordPress's core template files ([template hierarchy](https://developer.wordpress.org/themes/basics/template-hierarchy/) to your chosen layout directory (`/resources/views/layout`) by default.

```
( new \BigBoxWC\WP_Template_Loader\Loader() )::watch();
```

Instead of loading `/single.php`, `/resources/views/layout/single.php` is loaded instead.

### Defining Custom Directories

[](#defining-custom-directories)

The default view directory is `/resources/views` with a `layout` and `partials` directory relative to that. To change these pass them to the `Loader` instantiation.

```
( new \BigBoxWC\WP_Template_Loader\Loader( [
	'base_path'    => 'resources/templates',
	'layout_dir'   => 'wp-pages',
	'partials_dir' => 'parts',
] ) )::watch();
```

### Loading Views Manually

[](#loading-views-manually)

The `Loader` class also offers the ability to load views without using the WordPress' template loading system. These can easily be plugged in to any existing template helpers your theme may already be using.

#### Render a View

[](#render-a-view)

```
\BigBoxWC\WP_Template_Loader\Loader::view( 'my-view' );
```

Will output the contents of `resources/views/my-view.php`

#### Get a View

[](#get-a-view)

```
$view = \BigBoxWC\WP_Template_Loader\Loader::get_view( 'my-view' );
```

Will assign the contents of `resources/views/my-view.php` to a variable.

#### Render a View in a Custom Directory

[](#render-a-view-in-a-custom-directory)

```
\BigBoxWC\WP_Template_Loader\Loader::view( 'global/header' );
```

Will output the contents of `resources/views/global/header.php`

#### Render a View with Passed Variables

[](#render-a-view-with-passed-variables)

```
\BigBoxWC\WP_Template_Loader\Loader::view( 'global/header', [
	'min' => true,
] );
```

Will output the contents of `resources/views/global/header.php` with the variable `$min` available in the global scope.

#### Render a Partial

[](#render-a-partial)

The above methods can be repeated with the `partial()` method instead of `view()` to automatically look in the set `$partial_dir` location.

Contributing
------------

[](#contributing)

All feedback / bug reports / pull requests are welcome.

License
-------

[](#license)

This code is released under the GPL license.

For the full copyright and license information, please view the [`LICENSE`](LICENSE) file distributed with this source code.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

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 ~0 days

Total

3

Last Release

2938d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/38618848?v=4)[BigBox](/maintainers/bigboxwc)[@bigboxwc](https://github.com/bigboxwc)

---

Top Contributors

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

---

Tags

wordpresswordpress-development

### Embed Badge

![Health badge](/badges/bigboxwc-wp-template-loader/health.svg)

```
[![Health](https://phpackages.com/badges/bigboxwc-wp-template-loader/health.svg)](https://phpackages.com/packages/bigboxwc-wp-template-loader)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.1k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.2k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

282.2k](/packages/webkinder-sproutset)

PHPackages © 2026

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