內容簡介
提升 WordPress 的置頂文章功能。
這個外掛解決了 WordPress 核心實現置頂文章功能時以下問題和限制:
只有核心的 post 類型支持此功能。
置頂文章會被添加到首頁的結果前面,導致比已配置的每頁帖子數還要多的文章顯示。
隨著穿過存檔,置頂文章會再次出現。
當查詢特定文章時,置頂文章會被添加到結果的最前面。
難以在自定義查詢中包含置頂文章。
這些問題會導致一些奇怪的行為(例如在使用 REST API 時),並且使創建自定義主頁佈局變得複雜。
有一個時刻我們決定停止與核心抗爭,並部分重新實現此功能,使用自定義文章字段和元查詢,為您提供:
所有非階層式文章類型的置頂文章。
在文章類型和分類存檔中貼文置頂。
尊重您已設置的每頁帖子數,並將置頂帖子流到下一頁。
從存檔頁面篩選重複文章。
在幾乎任何 WP_Query 查詢中按黏性進行排序的功能。
支持 is_sticky() 函数。
可預測的 WordPress REST API 體驗。
略微增加 SQL 查詢負擔(抱歉!)
Post Glue 將繼續將文章 ID 保存到 sticky_posts 選項中,這意味著即使您決定停止使用該插件,您仍然會保留一些核心功能。
請在 Github 上關注和貢獻 Post Glue 的開發。
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
Sticky posts for WordPress, improved.
This plugin addresses the following issues and limitations found in the core’s implementation of sticky posts:
Only the core post type supports this feature.
Sticky posts are added in front of your homepage’s results, yielding more posts than the configured per-page setting.
Sticky posts reappear as you navigate further into the archive.
Sticky posts are prepended to your results when querying specific posts with post__in.
Difficult to include sticky posts in custom queries.
Some of these issues cause strange behaviour (like when using the REST API) and complicate the creation of custom homepage layouts.
At one point we decided to stop fighting the core and partially reimplemented the feature using custom post fields and meta queries, giving you:
Sticky posts for all non-hierarchical post types.
Post stickiness on post type and taxonomy archives.
Respect for your configured per-page setting, with stickies spilling over onto the next page.
Duplicates filtered from your archive pages.
The ability to sort by stickiness on virtually any WP_Query lookup.
Support for the is_sticky() function.
A predictable WordPress REST API experience.
A slight SQL query overhead (sorry!)
Post Glue will continue to save post IDs to the sticky_posts option, meaning you’ll retain some core functionality even if you decide to stop using the plugin.
Please follow and contribute to Post Glue’s development on Github.
