承接 mcaskill/sage-theme-wrapper 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  1. Add base.php to your theme's directory.
  2. 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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-05