mcaskill/sage-theme-wrapper
最新稳定版本:8.5.3
Composer 安装命令:
composer require mcaskill/sage-theme-wrapper
包简介
Standalone version of the Sage theme layout wrapper for WordPress.
关键字:
README 文档
README
Standalone version of the Sage Theme Wrapper for themes.
Installation
Require this package, with Composer, in the root directory of your project.
$ composer require mcaskill/sage-theme-wrapper
Usage
- Add
base.phpto your theme's directory. - Add the following filter to your theme's
functions.php:
Example #1:
<?php add_filter('template_include', [ '\\Roots\\Sage\\Wrapper', 'wrap'], 109);
Example #2:
<?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.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-05