內容簡介
這個外掛可以在一般文章或靜態頁面上,呈現不同於 WordPress 預設的精選圖片的相關內容。例如,輪播、影片、地圖或任何互動元素。該外掛會在編輯頁面中加入 metabox,以儲存內嵌代碼。請注意,顯示精選內容於您的模板正確位置,需要一點程式碼編寫。您可以從模板中呼叫一組函式,將精選內容顯示於指定位置。要建立 metabox,需要安裝 CMB2 外掛。
函式
the_featured_content() 採用當前文章或頁面 ID,輸出精選內容。
get_the_featured_content($post_id) 有一個可選參數(文章或頁面 ID),並返回精選內容的字串。
has_featured_content($post_id) 有一個可選參數(文章或頁面 ID),用於檢查是否存在精選內容。
外掛標籤
開發者團隊
原文外掛簡介
The featured content helps to featuring other media than the default featured image from WordPress on a regular post or static page. For example sliders, carousels, videos, maps or any kind of interactive elements. The plugin adds a metabox in the edit page for saving an embedded code. Note that a small coding is required to display the featured content in the right location of your template. You can display the featured content in the desired location of the page with a set of functions that you call from your template. The plugin CMB2 is required for creating metaboxes.
Functions
the_featured_content() takes the current post or page ID and outputs the featured content.
get_the_featured_content($post_id) has one optional parameter (post or page ID) and returns the featured content as a string.
has_featured_content($post_id) has one optional parameter (post or page ID) and checks whether a featured content exists.
