
內容簡介
此外掛可協助您為文章類型或自訂文章類型生成多個重新排序介面,以符合您的自訂開發需求。藉由自訂排序功能,爬蟲可更快速且容易地生成相同文章類型及個別文章類型的多個排序。
此外掛的開發目標是當您想在自訂模板中使用查詢程式碼(query code)時,可為一個文章類型(例如首頁)顯示自訂排序和同一個文章類型(例如自訂文章頁面)的自訂排序提供解決方案。
若要設定設定值,請前往 [WordPress 管理後台 -> 設定 -> Multiple Post Types Order],您會看到兩個選項:
顯示/隱藏文章類型重新排序介面
重新排序所需次數
設定完成後,"MPT Order #" 將顯示在您所需的文章類型上,您可拖曳重新排序,將文章標題移至所需的位置,點擊 "儲存",再點擊 "顯示查詢程式碼",您可在自訂模板中使用此查詢程式碼,自訂外觀及顯示您所需的結果。
顯示查詢程式碼範例:
<?php $data = new WP_Query(
array( 'post_type' => 'post',
'post_status' => array( 'publish'),
'posts_per_page' => -1,
'orderby' => 'meta_value_num',
'meta_key' => 'custom_order_type_snv_1',
'order' => 'ASC',
)); ?>
<?php while ( $data->have_posts() ) : $data->the_post(); ?>
<?php the_title(); ?>
<?php endwhile;?>
<?php wp_reset_query(); ?>
顯示 shortcode 範例:
[mpto post_type='post' meta_key='custom_order_type_snv_1']
或
[mpto post_type='post' meta_key='custom_order_type_snv_1' posts_per_page='10' limit='250' readmore='Readmore' style='style11' google_font='Roboto' item_width='300' item_height='300' des_size='10' title_size='18' it_margin='2' title_color='#ffffff' des_color='#ffffff']
shortcode Builder
`post_type` - 您在查詢程式碼中提供的文章類型列表
`meta_key` - 在查詢程式碼中提供的您的 meta key 值
`posts_per_page` - 顯示每頁列表數量
`limit` - 摘錄或內容的字元限制
`readmore` - 連結更多文字的自訂標籤
`style` - 您可以從 style1 到 style22 中選擇優秀的滑鼠懸停樣式效果
`google_font` - 您可以按名稱添加您想要的 Google 字體
`item_width` - 設定您想要的寬度
`item_height` - 設定您想要的高度
`des_size` - 設定您想要的描述字體大小
`title_size` - 設定您想要的標題字體大小
`it_margin` - 設定自訂右邊間距
`title_color` - 根據網站顏色設定標題顏色
`des_color` - 根據網站顏色設定描述顏色
插件優勢
可重新排列任何文章類型多次
支援階層式文章類型重新排序 - 包括父節點和子節點
支援從任何父節點重新排列單獨的子節點
注意事項
如果在設定重新排序後在前端無法顯示所需的結果,請按一次 "重置排序",然後重新設定重新排序。這將解決您的問題。
外掛標籤
開發者團隊
原文外掛簡介
This plugin helps to generate multiple re-ordering interface for your post types as well as custom post types as many times as you required for your custom development. With such a custom ordering facility, it will be much faster and easier for the crawlers to generate multiple ordering for same post types as well as individual post types.
This plugin development aims to get solutions when you want to display custom ordering for one post-type i.e. HomePage AND custom ordering for same post-type i.e. on Custom Post Page with the help of query code in your custom templates.
In order to configure settings, navigate to [ WordPress Admin -> Settings -> Multiple Post Types Order ], where you can see two options:
Show/Hide Re-Ordering Interface for Post Types
No of times Re-Ordering required
After configuring your settings, “MPT Order #” will be displayed on your desired post types and under it, you can drag and drop Re-Order by your Post Titles, hit ‘Save’ and click on Display Query Code. You can use this Query code in your custom templates and customize look-n-feel and your desired result will be displayed.
Example Display Query Code:
<?php $data = new WP_Query(
array( 'post_type' => 'post',
'post_status' => array( 'publish'),
'posts_per_page' => -1,
'orderby' => 'meta_value_num',
'meta_key' => 'custom_order_type_snv_1',
'order' => 'ASC',
)); ?>
have_posts() ) : $data->the_post(); ?>
