library sage-theme-wrapper
Standalone version of the Sage theme layout wrapper for WordPress.
mcaskill/sage-theme-wrapper
Standalone version of the Sage theme layout wrapper for WordPress.
- Friday, January 5, 2018
- by mcaskill
- Repository
- 1 Watchers
- 0 Stars
- 20 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 11 % Grown
Sage Theme Wrapper for WordPress
Standalone version of the Sage Theme Wrapper for themes., (*1)
Installation
Require this package, with Composer, in the root directory of your project., (*2)
$ composer require mcaskill/sage-theme-wrapper
Usage
- Add
base.php to your theme's directory.
-
Add the following filter to your theme's functions.php:, (*3)
Example #1:, (*4)
<?php
add_filter('template_include', [ '\\Roots\\Sage\\Wrapper', 'wrap'], 109);
Example #2:, (*5)
<?php
use Roots\Sage\Wrapper as W;
add_filter('template_include', function ($main) {
// Check for other filters returning null
if (!is_string($main)) {
return $main;
}
W::$main_template = $main;
W::$base = basename(W::$main_template, '.php');
if (W::$base === 'index') {
W::$base = false;
}
return new W('layouts/base.php');
}, 109);
Credits
All credits & copyrights belongs to people behind Sage., (*6)
dev-master
9999999-dev
Standalone version of the Sage theme layout wrapper for WordPress.
Sources
Download
MIT
The Requires
wordpress
wp
roots
sage
8.5.3
8.5.3.0
Standalone version of the Sage theme layout wrapper for WordPress.
Sources
Download
MIT
The Requires
wordpress
wp
roots
sage