定制 codeinwp/full-width-page-templates 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱: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 ;)

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固