PHPackages                             wpfulcrum/template - 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. wpfulcrum/template

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

wpfulcrum/template
==================

Fulcrum Template Module - empowering your plugin to load templates.

3.0.1(8y ago)110MITPHPPHP ^5.6|^7

Since Dec 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/wpfulcrum/template)[ Packagist](https://packagist.org/packages/wpfulcrum/template)[ Docs](https://github.com/wpfulcrum/template)[ RSS](/packages/wpfulcrum-template/feed)WikiDiscussions develop Synced 3d ago

READMEChangelogDependencies (8)Versions (4)Used By (0)

Template Module
===============

[](#template-module)

[![Build Status](https://camo.githubusercontent.com/5fe62b8a200b5861d4b6a2c2306d6be47109f7f467cb5c30d45ac3bf53494616/68747470733a2f2f7472617669732d63692e6f72672f777066756c6372756d2f74656d706c6174652e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/wpfulcrum/template)[![Latest Stable Version](https://camo.githubusercontent.com/ade3e560b097f1857fb963128c17a29c2359fde2defbf51f7513f6ac22f6bec8/68747470733a2f2f706f7365722e707567782e6f72672f777066756c6372756d2f74656d706c6174652f762f737461626c65)](https://packagist.org/packages/wpfulcrum/template)[![License](https://camo.githubusercontent.com/6e5db2a93e1978d976b1fb854205e4e912fda9811a94b10150f9b1431ef2cec5/68747470733a2f2f706f7365722e707567782e6f72672f777066756c6372756d2f74656d706c6174652f6c6963656e7365)](https://packagist.org/packages/wpfulcrum/template)

**Empowering your WordPress plugin to load templates.**

Does your plugin create a custom post type or taxonomy? Or maybe you want to add a page template into the page's template selector? The Fulcrum Template Module makes it easy for you.

Features
--------

[](#features)

- Theme override - if the template exists in the theme, it loads that one and not the plugin.
- Loads single, post type archive, and taxonomy templates from your plugin.
- Loads your custom template into the admin's page template select, allowing authors to select and assign your template to the page.
- If the page being loaded has a template assigned to it, it will load the plugin's template when available.

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

[](#installation)

The best way to use this component is through Composer:

```
composer require wpfulcrum/template

```

Dependencies
------------

[](#dependencies)

This module requires:

- at least PHP 5.6
- WordPress 4.8+

Configuration
-------------

[](#configuration)

There are 2 types of loaders, each requiring a separate configuration file in your plugin:

- Template loader - for the front-end
- Admin page template loader - for the back-end

### Template Loader Configuration

[](#template-loader-configuration)

The following example is for a "Book" custom post type with a "Genre" taxonomy:

```
