[WordPress] 外掛分享: Sticky CPT

首頁外掛目錄 › Sticky CPT
WordPress 外掛 Sticky CPT 的封面圖片
50+
安裝啟用
★★★★★
5/5 分(2 則評價)
2233 天前
最後更新
問題解決
WordPress 3.5+ v2.0.0 上架:2016-10-22

內容簡介

這個外掛程式可以像 WordPress 核心功能針對文章般,讓您也能對自訂文章類型(CPT)進行亮顯。

您可以將新建立的自訂文章類型的內容亮顯。

此外,也可以快速地透過批次動作來亮顯內容。

以下是使用範例:

$args = array(
'post_type' => ['project'],
'post_status' => 'publish',
'posts_per_page' => -1,
'post__in' => get_option( 'sticky_posts' )
);
$stickyProject = new WP_Query( $args );

可用的 Hook:

add_filter( 'sticky_cpt_add_cpt' , 'add_cpt' );

function add_cpt( $post_types ) {
$post_types['newcpt'] = 'newcpt';
return $post_types;
}

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Sticky CPT」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

The plugin allows to highlight the CPT in the same way as would the WordPress core functionality for posts.
You can highlight new content created for your CPT.
It is also possible to highlight the content quickly thanks to bulk actions.
Start example
$args = array(
'post_type' => ['project'],
'post_status' => 'publish',
'posts_per_page' => -1,
'post__in' => get_option( 'sticky_posts' )
);
$stickyProject = new WP_Query( $args );

Hook available
add_filter( 'sticky_cpt_add_cpt' , 'add_cpt' );

function add_cpt( $post_types ) {
$post_types['newcpt'] = 'newcpt';
return $post_types;
}

延伸相關外掛

文章
Filter
Apply Filters
Mastodon