PHPackages                             alexrah/wp-page-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. alexrah/wp-page-template-loader

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

alexrah/wp-page-template-loader
===============================

Helper Classes to inject page templates &amp; template parts

1.2.0(2y ago)06MITPHPPHP &gt;=8.0.0

Since Feb 13Pushed 2y ago1 watchersCompare

[ Source](https://github.com/alexrah/wp-page-template-loader)[ Packagist](https://packagist.org/packages/alexrah/wp-page-template-loader)[ Docs](https://github.com/alexrah/wp-page-template-loader)[ RSS](/packages/alexrah-wp-page-template-loader/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

About
-----

[](#about)

Helper class meant to be used in WP plugins to inject template-parts &amp; page-templates in the currenct active theme

Usage
-----

[](#usage)

in the plugin directory create the following dirs:

- template-pages
- template-parts

in the main plugin file initialize the class:

```
new WpPageTemplateLoader(__FILE__,$aOpts);
```

available `$aOpts` options:

- `filter_prefix`: define a custom prefix for filter &amp; action hooks, defaults to `$sPluginRootFile`
- `theme_template_directory`: define a folder name inside the current theme to scan for template-parts, default to `none`
- `plugin_template_pages_directory`: define the folder name inside the plugin where page-templates are stored, defaults to `template-pages`
- `plugin_template_parts_directory`: define the folder name inside the plugin where template-parts are stored, defaults to `template-parts`

install using composer:
-----------------------

[](#install-using-composer)

`composer require alexrah/wp-admin-custom-post-types`

published on packagist at:

Changelog
---------

[](#changelog)

### version 1.0.0

[](#version-100)

- helper classes to inject template-parts &amp; page-templates

Credits
-------

[](#credits)

- page-templates were adapted from
- template-parts were adaptad from

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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

4

Last Release

815d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/19648e66952936c124a58d9b115cf982047c8b58791c0045e95ff8dfb9cb416c?d=identicon)[alexrah](/maintainers/alexrah)

---

Top Contributors

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

---

Tags

wordpresstemplatewppage-templatetemplate-part

### Embed Badge

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

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

###  Alternatives

[fiskhandlarn/blade

A library for using Laravel Blade templates in WordPress/WordPlate.

365.8k](/packages/fiskhandlarn-blade)

PHPackages © 2026

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