前言介紹
- 這款 WordPress 外掛「Sort Query Posts」是 2011-01-14 上架。
- 目前有 100 個安裝啟用數。
- 上一次更新是 2012-09-04,距離現在已有 4624 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 2.5 以上版本才可以安裝。
- 有 3 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
tubal |
外掛標籤
post | sort | query | reorder | order_by |
內容簡介
這是一個非常簡單且輕量的外掛(包括註釋共 73 行程式碼),可以實時對文章進行排序,而不需要向數據庫發送新的查詢請求(有助於提高性能)。
功能:
支持 query_posts 函数 的所有 order_by 及 order 值,除了需要數據庫查詢的 meta_value 及 meta_value_num。
支持對所有類型的文章進行排序,包括自定義文章類型及自定義文章類型 “存檔” 文章。
文檔:
此外掛將函數 sort_query_posts_by(string $order_by [, string $order]) 添加到全局上下文中。
第二個 $order 參數是可選的,其默認值為 asc(升序排列)。
在 循環遍歷 之前調用此函數可以更改文章排序方式。
調用此函數後,您可以像平常一樣顯示文章。
您可以按以下方式對文章進行排序:
作者
評論數
日期
ID
菜單順序
修改日期
父級
標題
此外掛在以下兩種情況下特別有用:
當您需要對 WordPress 從您提供的 URL 創建的查詢返回的文章進行重新排序時,例如,自定義文章類型的 “存檔” 文章就是這種情況的絕佳範例。
當您需要在同一頁面上多次顯示並按不同方式進行排序的自定義查詢所返回的文章時。
範例:
上述範例將按標題降序排序文章,而不需要向數據庫發送新的查詢請求。
這樣排序是有利於性能的。
上述範例將按文章 ID 升序排序。
上述範例將隨機排序文章。當按隨機排序時,$order 參數將被忽略。
此外掛由 Túbal Martín 在 www.margenn.com 開發。
原文外掛簡介
A really simple and lightweight plugin (73 lines of code – comments included) to sort posts on-the-fly without making a new query to the database (improves performance).
Features:
Supports all order_by and order values of the query_posts function except meta_value and meta_value_num (which require a database query).
Supports changing the order of all types of posts, including custom post type posts and custom post type “archive” posts.
Documentation
This plugin adds the function sort_query_posts_by(string $order_by [, string $order]) to the global context.
The second $order parameter is optional. Its default value is asc (ascending order).
Call this function before the loop to change how posts are ordered.
After calling this function you can show the posts as you normally would.
You can sort posts by:
author
comment_count
date
id
menu_order
modified
parent
title
This is specially useful in two cases:
When you need to reorder the posts returned by the query that WordPress creates from your given URL. Custom post type “archive” posts are a great example of this case.
When you need the posts returned by your customized query (e.g. query_posts()) to be shown more than once on the same page and ordered differently.
Examples:
The example above will sort posts by their title in descending order without making a new query to the database.
This way sorting is performance friendly.
The example above will sort posts by their ID in ascending order.
The example above will sort posts randomly. When sorting randomly $order is ignored.
Plugin developed by Túbal Martín at www.margenn.com.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Sort Query Posts」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Simple Page Ordering 》這個外掛可以用簡單的拖放操作,讓您對頁面、樹狀自訂文章類型或是擁有「頁面屬性」的自訂文章類型進行排序,只需要使用內建的頁面列表就能完成。, 只要簡單...。
Rearrange Woocommerce Products 》重新排列Woocommerce產品( Rearrange Woocommerce Products)是一款WordPress外掛,可以讓您重新排列/重新排序Woocommerce商店頁面上產品的默認排序順序,也可...。
Reorder Posts 》此外掛可幫助您輕鬆地重新排序 WordPress 自訂文章類型的文章。它在 WordPress 管理面板中添加了拖放功能以用於文章排序,並支援自訂文章類型和常規文章。, ...。
ReOrder Posts within Categories 》由於 WordPress 核心的錯誤,導致檔案分類法查詢在前端沒有被正確排序。如果您的文章不在前端網站中被排序,請閱讀這個討論串以獲取更多資訊。, v2.3現在支援...。
pageMash > Page Management 》使用此簡單的 AJAX 拖放管理介面,自訂頁面的排序,並管理父頁面結構,還有可選擇隱藏輸出頁面的選項。是一個快速重排頁面選單的好工具。, 查看範例頁面:htt...。
Cancel order request / Return order / Repeat Order / Reorder for WooCommerce 》這個外掛可以替 WooCommerce 取消訂單按鈕加上訂單取消請求按鈕,以下是本外掛的功能:, ✅ 根據訂單狀態啟用訂單退款請求,並且取代 WooCommerce 的取...。
Terms Order WP – Categories And Taxonomies Order Plugin 》這個外掛可以幫助你排序或重新排序預設網誌類別和自訂文章型別的分類法和術語,外掛準備好使用,不需要進行任何配置。使用者友善的介面可以讓你輕鬆完成任務...。
Reorder Terms 》we consider Reorder Terms a developer tool. If you do not know what menu_order or custom queries are, then this plugin is likely not for you. This...。
Reorder by Term 》Reorder By Term 是一個開發者工具。如果你不知道什麼是 menu_order 或自訂查詢,那麼這個外掛可能不適合你。這是 Reorder Posts 的附加功能,需要 Reorder P...。
postMash – custom post order 》文章通常以相反的時間順序列出,因為它們經常用於刊登定期的時間導向內容。, postMash 讓您使用簡單的 Ajax 拖放管理介面自訂文章的排序方式。此外,它還提供...。
Product Rearrange for WooCommerce 》Product Rearrange for WooCommerce 是一個外掛,它可以讓您在後台使用直觀的拖曳排序方式最強大地重新排列 WooCommerce 產品。這個外掛將盡可能保存排序順序...。
PostMash Custom – custom post order 》文章通常按時間倒序列出,因為它們通常用於發佈定期時間導向的內容。, PostMash Custom 允許您使用簡單的 Ajax 拖放管理界面自定義文章列表順序,包括常規文...。
Flexible Subscriptions 》總結:, 這款「彈性訂閱」WordPress外掛是WooCommerce訂閱外掛的最佳免費替代方案。它讓你可以將商品轉換成訂閱形式,在網店中銷售線上課程和訂閱產品,處理...。
Menu Humility 》一些外掛程式(我指的是 Automattic)會將頂層導覽列置於第一個菜單群組中,在「儀表板」下方。這很煩人,因為這些項目通常比文章、頁面、評論等其他東西來得...。
Custom Posts Order 》Custom Posts Order 外掛可以藉由簡單的拖曳排序功能為文章排序。在頁面、文章、文字小工具或範本檔案中放置捷徑以顯示在前端,使用起來非常簡單。, , 快速且...。