
內容簡介
Advanced Custom Fields: Typography Field 外掛為「Advanced Custom Fields」提供了一個排版欄位類型,讓使用者能夠輕鬆添加各種文字屬性,如字型大小、字型系列和字型顏色等,提升網站的文字設計。
【主要功能】
• 支援多種文字屬性設定
• 自動載入 Google Fonts
• 支援 Gutenberg 區塊
• 可單獨顯示/隱藏每個子欄位
• 提供顏色選擇器功能
外掛標籤
開發者團隊
② 後台搜尋「Advanced Custom Fields: Typography Field」→ 直接安裝(推薦)
原文外掛簡介
Typography field type for “Advanced Custom Fields” plugin that lets you add different text properties e.g. Font Size, Font Family, Font Color etc.
Supported Subfields
Font Size
Font Family
Font Weight
Font Style
Font Variant
Font Stretch
Line Height
Letter Spacing
Text Align
Text Color
Text Decoration
Text Transform
Other Features
Supports Google Fonts. The selected Google Fonts are automatically enqueued on front-end of posts/pages. Google Fonts also work with ACF Options.
Supports Gutenberg Blocks created with ACF.
Option to show/hide each subfield individually
Option to make each subfield required individually
Color Picker for Text Color subfield
Documentation
// Returns the value of a specific property
get_typography_field( $selector, $property, [$post_id], [$format_value] );
// Displays the value of a specific property
the_typography_field( $selector, $property, [$post_id], [$format_value] );
// Returns the value of a specific property from a sub field.
get_typography_sub_field( $selector, $property, [$format_value] );
// Displays the value of a specific property from a sub field.
the_typography_sub_field( $selector, $property, [$format_value] );
Shortcode
[acf_typography field="field-name" property="font_size" post_id="123" format_value="1"]
The shortcode only reads Typography fields.
Github repository
@mujahidi/acf-typography
Compatibility
This ACF field type is compatible with:
* Free and paid versions of the ACF plugin
