【官方】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