codeinwp/full-width-page-templates 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

codeinwp/full-width-page-templates

Composer 安装命令:

composer require codeinwp/full-width-page-templates

包简介

A WordPress library to create full width page templates.

README 文档

README

A composer library which injects, in WordPress Dashboard, a Full-Width option in the Page Template selector.

Codacy Badge

Supported Builders:

  • A plain simple WordPress page
  • Elementor

Compatible themes?

At this moment this library ensures compatibility with the follwing WordPress themes(and more to come):

How to use it?

Well, this is a Composer library so you will need to add this it as a dependency on your project( either plugin or a theme ) like this:

"require": {
    "codeinwp/full-width-page-templates": "master"
}

And run a via the terminal a composer install and hope that you have Composer installed globally.

The last step is the initialization. Call this wherever you like:

if ( class_exists( '\ThemeIsle\FullWidthTemplates' ) ) {
    \ThemeIsle\FullWidthTemplates::instance();
}

Work with this repository?

To work directly with this repository, I use and recommend the following way.

Clone this repository inside the mu-plugins WordPress directory. This way, we can be sure that the cloned version of this library will have priority before the one loaded from Composer. After cloning you need to create a php file, like load-fwt-lib.php(I'm so bad at naming) and inside you will need to require the loader like this:

<?php
require_once( dirname( __FILE__ ) . '/full-width-page-templates/load.php' );

How to make a theme compatible with the full-width template?

To add a new theme to the compatibility list, clone this repository(as we talked above) create a new directory with the theme's name in the themes directory. This theme directory supports two files:

  • inline-style.php - A file loaded at the right moment to add an inline style
  • functions.php - An optional file to add actions and filters.

Our goal here is to add a CSS snippet which will make sure that the page container width full. So make use of the inline-style.php and add a snipet like this:

<?php
/* Support for the {Theme Name} theme */
$style = '.page-template-builder-fullwidth-std .site-content {
    width: 100%;
    padding: 0;
    margin:0;
}';
wp_add_inline_style( '{theme-style}', $style );

Where {theme-style} must be an enqueued style.(For example, Twenty Seventeen has 'twentyseventeen-style')

Don't forget to add the new theme to this README.md ;)

codeinwp/full-width-page-templates 适用场景与选型建议

codeinwp/full-width-page-templates 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.28k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 01 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 codeinwp/full-width-page-templates 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 codeinwp/full-width-page-templates 我们能提供哪些服务?
定制开发 / 二次开发

基于 codeinwp/full-width-page-templates 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 4.28k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 16
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2018-01-15