定制 upstatement/timber-starter-theme 二次开发

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

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

upstatement/timber-starter-theme

最新稳定版本:2.0.0

Composer 安装命令:

composer require upstatement/timber-starter-theme

包简介

Starter theme to build a Timber theme

README 文档

README

Build Status Packagist Version

The "_s" for Timber: a dead-simple theme that you can build from. The primary purpose of this theme is to provide a file structure rather than a framework for markup or styles. Configure your SASS files, scripts, and task runners however you would like!

Installing the theme

Follow the guide on how to Install Timber using the Starter Theme.

Then,

  1. Rename the theme folder to something that makes sense for your website. You could keep the name timber-starter-theme but the point of a starter theme is to make it your own!
  2. Activate the theme in the WordPress Dashboard under Appearance → Themes.
  3. Do your thing! And read the docs.

The StarterSite class

In functions.php, we call new StarterSite();. The StarterSite class sits in the src folder. You can update this class to add functionality to your theme. This approach is just one example for how you could do it.

The src folder would be the right place to put your classes that extend Timber’s functionality.

Small tip: You can make use of Composer’s autoloading functionality to automatically load your PHP classes when they are requested instead of requiring one by one in functions.php.

What else is there?

  • assets/ is where you can keep your front-end scripts, styles, or images. In other words, your Sass files, JS files, fonts, and SVGs would live here.
  • views/ contains all of your Twig templates. These pretty much correspond 1 to 1 with the PHP files that respond to the WordPress template hierarchy. At the end of each PHP template, you’ll notice a Timber::render() function whose first parameter is the Twig file where that data (or $context) will be used. Just an FYI.
  • tests/ ... basically don’t worry about (or remove) this unless you know what it is and want to.

Other Resources

统计信息

  • 总下载量: 7.53k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 833
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 833
  • Watchers: 44
  • Forks: 277
  • 开发语言: Twig

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固