Skip Navigation

[Resolved] 關於新開的post type文章如何置頂

This support ticket is created 5 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 5 years ago.

Assisted by: Luo Yang.

Author
Posts
#1417681

請教關於新開的post type文章如何置頂?謝謝

#1417777

你好,

你説的應該是WP自帶的Sticky Posts功能:
https://wordpress.org/support/article/sticky-posts/

自定義文章類型(新開的post type)不支持文章置頂功能,參考WP core ticket:
https://core.trac.wordpress.org/ticket/12702

#1417791

那我該如何找替代方案
1.外掛?是否有推薦
2.如何透過其他方式達成解決這需求,讓某幾篇文章置頂

#1417831
my-sticky.JPG

可以通過其他方式實現,比如:
1) 創建一個custom checkbox field "my-sticky",參考截圖my-sticky.JPG
2)編輯你要置頂的文章,啓用"my-sticky"選項,保存
3) 創建一個post view, 添加一個filter:
Select items with field:
my-sticky is a number equal to 1

然後使用上面的Post view來顯示所有置頂的自定義文章:
https://toolset.com/documentation/user-guides/views/filtering-views-by-custom-fields/