[WordPress] 外掛分享: No Sub-Category Posts in Loops

前言介紹

  • 這款 WordPress 外掛「No Sub-Category Posts in Loops」是 2009-01-29 上架。
  • 目前有 100 個安裝啟用數。
  • 上一次更新是 2015-11-19,距離現在已有 3454 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.1 以上版本才可以安裝。
  • 有 3 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

hallsofmontezuma |

外掛標籤

cats | loop | posts | categories |

內容簡介

這個外掛啟用後,只會在迴圈中顯示當前分類的文章(不會顯示子分類中的文章)。
這就是它的全部功能,沒有任何選項。如果您需要選項,請告訴我,我會加入進去。

從 0.4 開始,我在主查詢(main query)建立後移除過濾器,以免與小工具(widget)產生衝突。
如果您有自定義查詢或是在分類存檔模板中呼叫 wp_query,您需要在查詢之前和之後添加和移除過濾器。下面是一個使用 wp_query 的示例。再次重申,只有在模板文件中修改查詢時才需要這樣做。

add_filter( 'posts_where', 'ft_nscp_mod_where' );
query_posts( array( 'your-custom' => 'args' ) );
remove_filter( 'posts_where', 'ft_nscp_mod_where' );

重要的是要刪除您添加的內容。

原文外掛簡介

Once activated, only posts from the current category are displayed in your loop (no posts from sub cats).
That’s all it does. No options. If you find you need options, let me know and I’ll build them into it.
As of 0.4 I remove the filter after the main query is built so that it doesn’t interfere with widgets.
If you have a custom query or call wp_query on a category archive template, you’ll need to add and remove the filters before and after your query. Below is an example of how to do this if you use wp_query. Again, this is not necessary unless you have modified queries in a template file.
add_filter( 'posts_where', 'ft_nscp_mod_where' );
query_posts( array( 'your-custom' => 'args' ) );
remove_filter( 'posts_where', 'ft_nscp_mod_where' );

Its important that you remove what you add.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「No Sub-Category Posts in Loops」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.1 | 0.2 | 0.3 | 0.4 |

延伸相關外掛(你可能也想知道)

  • CATS Job Listings 》本外掛可透過使用簡碼,在 WordPress 網站上顯示從 CATS 應徵者追蹤系統擷取的工作職缺列表。, 使用本外掛需擁有catsone.com帳戶。。
  • catnip 》catnip 可讓你在 WordPress 主題的側邊欄或任何頁面中加入隨機貓咪的可愛有趣圖像,使用 catnip 短代碼即可。, 目前 catnip 已經整合自 The Cat API 的 API ...。
  • CTL Playful Kitty Lite 》將 Playful Kitty Lite 加入到 CTL Arcade Lite 插件中, Playful Kitty Lite 是一款基於 HTML5 的物理遊戲。, 這只可愛的貓咪想要玩耍!將羊毛球帶給貓咪,通...。

文章
Filter
Apply Filters
Mastodon