【官方】https://codex.wordpress.org/Theme_Frameworks
一个主题框架应该有以下几个主要特点
- 通常它主要由一个父主题组成,这个父主题会被设计成能与子主题联合使用。在某些情况下,父主题也会单独使用,但是在其他一些情况下,父主题非得和子主题连在一起才能使用——WordPress 法典将其分别定义为“基础/入门主题”和“代码库”。
- 通常它包括一些可以被子主题和插件利用的钩子和函数。你的主题框架是整个生态系统的基础,它还包括部分与框架钩连的插件。
- 如果是给由不会编程的用户使用,它会包括主题选项页面,这样可以让用户根据自己的需求来自定义主题。设计、布局、功能和内容等等都可以是多样且混合的。在某些情况下,一些功能可以经由主题定制器来提供。
- 它可能包括多个小工具区域,因而非技术用户可以通过 WordPress 小工具(包括你专门为框架编写的通过插件添加的小工具)添加内容或代码。
- 它可能还包括脚本库功能,如 jQuery 滑块或灯箱特效。根据你和用户的需要,你可能会需要在主题框架中将这些合并到一起,或提供一些与框架相钩连的插件。
- 通常它是可扩展的,并能用钩子让你通过子主题和相关插件扩展其功能。
一个主题框架的要素
- 父主题和可供选择的子主题
- 动作和过滤挂钩
- 函数
- 主题选项
- 小工具
- 脚本
- 可扩展性
What is a theme framework?
Frameworks are for theme developers. They offer a set of standards for theme developers to use in creating their own themes. They’re a set of functions/features created to aid development.
How Frameworks Work?
Frameworks come packaged within a single folder.
Developers drop the framework folder into a new parent theme and load the framework.
Users create a child theme based on the parent theme to house their customizations, allowing both the framework and parent theme to be updated.
Some examples of such frameworks include:
Carrington Core
Codestar Framework
Gantry Framework
Hybrid Core
Beans Theme Framework
Options Framework
SMOF
Unyson
UpThemes Framework
Vafpress Framework
WordSmith
Cherry
TypeRocket Framework
Commercial framework examples:
Genesis Framework
Functionality Included in Theme Frameworks
主题框架包括哪些功能
Some Theme Frameworks will include pre-defined code to facilitate further Theme development, such as:
一些主题框架将包括事先定义的代码来帮助以后的主题开发,例如:
Custom functions to be used in the Theme
用于主题的定制化功能
Custom action hooks used in the Theme template
用于主题模版的定制化动作钩子
Custom filter hooks used to output Theme content
定制化过滤器钩子用于输出主题内容
Theme options page integration
主题可选页
Custom callbacks for core WordPress action and filter hooks
定制化回调函数 针对 核心动作和过滤器钩子
Script library integration and functionality, e.g. jQuery sliders
Scirpt库集成和功能性,例如jQuery sliders
Recommended reading
Frameworks? Parent, child, and grandchild themes?
框架?父主题,子主题和
How I used a WordPress Child Theme To Redesign My Blog The Smart Way
Why I created a WordPress theme framework
Parent/Child Themes in WordPress: The Future of WordPress Themes
Theme Inheritance
How to make a “child theme” for WordPress. A pictorial introduction for beginners
Category:
Design and Layout