內容目錄
前言介紹
- 這款 WordPress 外掛「Featured Posts Pro」是 2016-10-02 上架。
- 目前有 100 個安裝啟用數。
- 上一次更新是 2019-04-04,距離現在已有 2222 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0.1 以上版本才可以安裝。
- 有 5 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
featured | featured posts | featured post widget |
內容簡介
Featured Posts Pro
讓管理員和編輯能夠輕易地將文章、頁面和自訂文章設定為特色文章。您可以在文章列表頁面或文章編輯頁面上透過勾選方塊,將文章、頁面和自訂文章設為特色文章。請參閱截圖以了解更多。
Featured Posts Pro 也新增了一個小工具,用於列出最近的特色文章。這與預設的最新文章小工具類似,但這個小工具會顯示最近的特色文章。Featured Posts Pro 小工具的樣板可以透過您的佈景主題進行自訂。
如何在佈景主題中使用
要取得特色文章,您需要建立自訂查詢,如下所示:
取得帶有排列順序的特色文章範例程式碼
$args = array(
‘post_type’ => ‘any’,
‘posts_per_page’ => 10,
‘no_found_rows’ => true,
‘post_status’ => ‘publish’,
‘ignore_sticky_posts’ => true,
‘meta_query’ => array(
array(
‘relation’ => ‘OR’,
array(
‘key’ => ‘post_featured_position’,
‘compare’ => ‘EXISTS’
),
array(
‘key’ => ‘post_featured_position’,
‘compare’ => ‘NOT EXISTS’
),
),
array(
‘relation’ => ‘AND’,
‘key’ => ‘is_post_featured’,
‘compare’ => ‘=’,
‘value’ => 1
)
),
‘orderby’ => ‘meta_value_num’,
‘order’ => ‘ASC’,
) ;
$featuredPosts = new WP_Query( $args );
取得沒有排序的特色文章範例程式碼
$args = array(‘posts_per_page’ => 10,
‘no_found_rows’ => true,
‘post_status’ => ‘publish’,
‘ignore_sticky_posts’ => true,
‘meta_key’ => ‘is_post_featured’ // 這是用於特色文章的元鍵
) ;
$featuredPosts = new WP_Query( $args );
或者如果您只想
如何自訂小工具
您可以按照以下步驟自訂小工具樣板:
1. 在您的佈景主題資料夾中建立名為 ‘featured_posts_pro_tpls’ 的資料夾
2. 在剛才建立的 ‘featured_posts_pro_tpls’ 資料夾中建立兩個名為 ‘tpl_featured_posts_pro_large.php’ 和 ‘tpl_featured_posts_pro_small.php’ 的 PHP 檔案
3. 當小工具大小設定為大時,樣板檔案 ‘tpl_featured_posts_pro_large.php’ 將用於呈現小工具,同理,‘tpl_featured_posts_pro_small.php’ 則用於小型小工具
4. 從插件資料夾 > featured-posts-pro > public > partials > featured_posts_pro-widget.php 中複製並貼上內容到上述兩個檔案中
原文外掛簡介
Featured Posts Pro
allows administrator and editor an option to set posts, pages & custom posts as a featured posts very easily. Posts, pages & custom posts can be set as featured posts using a checkbox on the posts list page or on the edit page of the post. Please see screenshots to be more clear.
Featured Posts Pro
also adds a widget that will list the recent featured posts. This is similar to the default recent posts widget except this widget displays recent featured posts instead. The template for the Featured Posts Pro Widget can be customized with your theme.
How to use in the theme
You can to get the featured posts, you need to make a custom query as follows
sample code to get the featured posts with orders
`$args = array(
‘post_type’ => ‘any’,
‘posts_per_page’ => 10,
‘no_found_rows’ => true,
‘post_status’ => ‘publish’,
‘ignore_sticky_posts’ => true,
‘meta_query’ => array(
array(
‘relation’ => ‘OR’,
array(
‘key’ => ‘post_featured_position’,
‘compare’ => ‘EXISTS’
),
array(
‘key’ => ‘post_featured_position’,
‘compare’ => ‘NOT EXISTS’
),
),
array(
‘relation’ => ‘AND’,
‘key’ => ‘is_post_featured’,
‘compare’ => ‘=’,
‘value’ => 1
)
),
‘orderby’ => ‘meta_value_num’,
‘order’ => ‘ASC’,
) ;
$featuredPosts = new WP_Query( $args );
sample code to get the featured posts without order
$args = array(
‘posts_per_page’ => 10,
‘no_found_rows’ => true,
‘post_status’ => ‘publish’,
‘ignore_sticky_posts’ => true,
‘meta_key’ => ‘is_post_featured’ //this is the meta key used for the featured posts
) ;
$featuredPosts = new WP_Query( $args );`
or if you simple want tp
How to customize the widget
You can customize the widget template as follows:
1. create a folder ‘featured_posts_pro_tpls’ inside your theme folder
2. create two php files named as ‘tpl_featured_posts_pro_large.php’ & ‘tpl_featured_posts_pro_small.php’ in the ‘featured_posts_pro_tpls’ folder you just created
3. template file ‘tpl_featured_posts_pro_large.php’ will be used to render the widget when widget size is selected as large & similarly ‘tpl_featured_posts_pro_small.php’ is for small widget size
3. copy and paste the content from plugin_fold er > featured-posts-pro > public > partials > featured_posts_pro-widget.php in the above two files
4. make the layout changes as you wish.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Featured Posts Pro」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0 | 1.1 | 1.2 | 1.4 | 1.3.0 | 1.3.1 | 1.3.2 | 1.3.3 | 1.3.4 | 1.3.5 | 1.3.6 | 1.3.7 | 1.3.8 | 1.3.9 | trunk |
延伸相關外掛(你可能也想知道)
Featured Image from URL (FIFU) 》h3>WordPress 外掛 - 用於顯示外部特色圖片、影片、音訊等等, FIFU 自 2015 年來已幫助全球數千個網站節省了儲存空間、處理時間和版權費用。, 如果您已經厭倦...。
Post Thumbnail Editor 》為了滿足主題中文章縮圖大小隨機而任性的需求(導致 WordPress 簡單地從中間剪裁圖像(無論是切掉頂部和底部還是切掉兩側)),此外掛試圖為用戶提供一個介面...。
Conditionally display featured image on singular posts and pages 》注意事項, 如果你的佈景主題使用自訂調用來載入特色圖片(如 Twenty Seventeen 主題),則本外掛可能無法運作!請使用 get_the_post_thumbnail()、wp_get_att...。
Hide Featured Image 》有些情況下,我們可能想在某個單獨的文章頁面上顯示特色圖片,但另一些文章頁面則不想顯示。, 這個外掛可以讓您在單獨的文章頁面上顯示或隱藏特色圖片,同時...。
Featured Image Admin Thumb 》啟用此外掛後,它會在「所有文章/所有頁面」及支援的所有自訂文章類型管理介面中新增一欄,名為「Thumb」。這一欄會顯示文章特色圖片或者是文章縮圖的縮略圖...。
Featured Video Plus 》, 一張圖片勝過千言萬語,那麼一段影片能代表多少言語呢?, , Featured Videos 和 Featured Images 類似,只是更加流暢:在文章編輯頁面中貼上影片 URL 到指...。
Daddy Plus 》總結:, 這個 Daddy Plus 外掛是為 Themes Daddy 而製作的,它可以為 Themes Daddy 添加自訂的首頁區塊,並允許你對主題首頁區塊進行完全的自訂設置。這個外...。
NS Featured Posts 》NS精選文章, 此外掛為每個列表項目新增核取方塊。您可以輕鬆勾選/取消勾選「精選文章」功能,勾選時會為 meta key _is_ns_featured_post 設置 meta value 為 ...。
YITH WooCommerce Featured Video 》YITH WooCommerce Featured Video 插件是一個擴展 WooCommerce 插件的外掛,允許你的使用者在產品詳細頁面上看到 YouTube 或 Vimeo 影片而不是特色圖片。, 在...。
Featured Galleries 》開發 Hello 佈景主題的開發人員們,您好!, 您是否曾經想要為一篇文章新增多個特色圖片呢?現在透過「Featured Galleries」外掛,您就可以這麼做了!這個外掛...。
WP Hide Show Featured Image 》這個外掛提供了隱藏所有文章和頁面的精選圖片的選項。, 功能, 隱藏所有文章和頁面的精選圖片。, 隱藏用戶端的管理員工具列。, 移除管理員儀表板右上角的問候...。
Better REST API Featured Images 》注意:您可能不需要此外掛。 REST API 已經支援在 URL 中添加查詢參數 ?_embed,並且回應將包括所有“嵌入式媒體”,包括特色圖片,在那裡獲得的數據正是此外掛...。
WPFrank Companion 》這是 WP Frank 主題的附屬外掛。, 該外掛為 WP Frank 主題添加自定義首頁區段,並允許您對主題首頁區段進行完全的自定義設置。, 該外掛的選項非常用戶友好,...。
RSS Featured Image 》RSS Featured Image 外掛會在你的 RSS 饋料中(在 media:content 中)加入精選圖片。它與 Mailchimp (|RSSITEM:IMAGE|) 相容。實際上,它基本上和另一個更出...。
Featured Image Generator 》您曾經為網站尋找特色圖片而感到困難嗎?這個外掛可以在 unsplash.com 等免費授權的優秀照片中搜尋,並在一個按鈕中將其導入到您的網站。該外掛包括圖層、色...。