
內容簡介
本外掛可輕鬆設置首頁、日期文章存檔、分類/標籤/分類法文章存檔和搜尋區的介面和可用排序。
排序項目
文章日期
文章標題
文章作者
文章評論數
文章 ID
文章最後修改日期
文章順序(頁面屬性/菜單順序)
文章自訂欄位
針對標題排序
可針對文章標題排序時,忽略開頭的字詞。
例如:
* The
* A
針對自訂欄位排序
可自動判斷排序欄位是否為數字(meta_key_num)或字串(meta_key)而排序。
動作/過濾器
你可以在本外掛之前和之後執行動作。
add_action( 'apsc_before_sort' , 'custom_apsc_before_sort' , 10 , 2 );
function custom_apsc_before_sort( $wp_query , $setting_data ) {
//print_r($wp_query);
//print_r($setting_data);
}
add_action( 'apsc_after_sort' , 'custom_apsc_after_sort' , 10 , 2 );
function custom_apsc_after_sort( $wp_query , $setting_data ) {
//print_r($wp_query);
//print_r($setting_data);
}
除錯
啟用Debug Bar外掛後可查看除錯資訊。
外掛標籤
開發者團隊
② 後台搜尋「Archive Posts Sort Customize」→ 直接安裝(推薦)
原文外掛簡介
Easily settings interface and available sort to home, date archives, category/tag/taxonomy archives, search.
Sort Items
Post Date
Post Title
Post Author
Post Comments Count
Post ID
Post Last Modified
Post Order (page attributes/menu_order)
Custom Field of Post
For sort order to title
Available to ignore words of beginning of the title for post title of sort.
e.g.)
* The
* A
For sort order to custom fields
Available to automatically whether sort to number (meta_key_num) or sort to string(meta_key).
For Action/Filter
You will possible to action before and after the this plugin.
add_action( 'apsc_before_sort' , 'custom_apsc_before_sort' , 10 , 2 );
function custom_apsc_before_sort( $wp_query , $setting_data ) {
//print_r($wp_query);
//print_r($setting_data);
}
add_action( 'apsc_after_sort' , 'custom_apsc_after_sort' , 10 , 2 );
function custom_apsc_after_sort( $wp_query , $setting_data ) {
//print_r($wp_query);
//print_r($setting_data);
}
For Debug
You will possible to see the debug information after activate the Debug Bar plugin.
