説明
Select sortable items from ‘Intuitive CPO’ menu of Setting menu in WordPress.
Intuitively, order items( Posts, Pages, Custom Post Types, Custom Taxonomies, Sites ) using a drag and drop sortable JavaScript.
Use parameters( orderby = menu_order, order = ASC ) in your theme.
You can also override the auto-converted parameters( orderby and order ).
ATTENTION: Only if you use ‘get_posts()’ to re-overwrite to the default order( orderby = date, order = DESC ), You need to use own custom parameter ‘orderby = default_date’.
このプラグインは GitHub に掲載されています。
インストール
/wp-content/plugins/
ディレクトリに ‘intuitive-custom-post-order’フォルダーをアップロードします。- 「プラグイン」メニューからプラグインを有効化します。
- Select sortable items from ‘Intuitive CPO’ menu of Setting menu in WordPress.
FAQ
-
‘orderby’と ‘order’のパラメータを上書きする方法
-
サブクエリ
‘WP_Query’を使用すると、パラメータを再上書きできます。
WP_Query
<?php $query = new WP_Query( array( 'orderby' => 'ID', 'order' => 'DESC', ) ) ?>
get_posts()
<?php $query = get_posts( array( 'orderby' => 'title', ) ) ?>
注意: ‘get_posts()’を使用してデフォルトの順序(orderby = date、order = DESC)に上書きする場合にのみ、独自のカスタムパラメータ ‘orderby = default_date’を使用する必要があります。
<?php $query = get_posts( array( 'orderby' => 'default_date', 'order' => 'DESC', ) ) ?>
メインクエリ
‘pre_get_posts’アクションフックまたは ‘query_posts()’を使用すると、パラメータを再上書きできます。
pre_get_posts
function my_filter( $query ) { if ( is_admin() || !$query->is_main_query() ) return; if ( is_home() ) { $query->set( 'orderby', 'date' ); $query->set( 'order', 'DESC' ); return; } } add_action( 'pre_get_posts', 'my_filter' );
query_posts()
<?php query_posts( array( 'orderby' => 'rand' ) ); ?>
-
How to move post of second page in top of first page.
-
「画面オプション」に移動し、「1ページあたりの項目数:」を変更します。
評価
貢献者と開発者
変更履歴
3.1.2.1
- Update the WordPress version this plugin was tested.
3.1.2
- Solved the problem of layout collapse during drag and drop sorting.
3.1.1
- Remove deprecated function ‘secreen_icon()’.
3.1.0
- サイトをサポートする。
- アクティベーションの改善。
3.0.8
- Even for ‘get_posts()’, Your custom Query which uses the ‘order’ or ‘orderby’ parameters is preferred.
ATTENTION: Only if you use ‘get_posts()’ to re-overwrite to the default order( orderby=date, order=DESC ), You need to use own custom parameter ‘orderby=default_date’.
3.0.7
- このプラグインは上記のtranslate.wordpress.org翻訳システムにインポートされます。完全に翻訳されたローカルの言語パックも、このプラグインで有効になります(100%)。
3.0.6
- Support ‘next_post_link()’ and ‘previous_post_link(), etc.
- Parameters( $in_same_term, $excluded_terms, $taxonomy ) works perfectly.
3.0.5
- Fixed bug
- Initialize of menu_order of pages.( orderby=menu_order, post_title, order=asc )
3.0.4
- Your custom Query which uses the ‘order’ or ‘orderby’ parameters is preferred.
In order to prefer the parameters of your query, You must use the ‘WP_Query()’ or ‘query_posts()’.
Excluded ‘get_posts()’. - Fixed bug
- Decision of Enabling Sortable JavaScript.
- Initialize of menu_order of pages.( orderby=post_title, order=asc )
3.0.3
- アクティベーションのパフォーマンス向上。
- カスタムタクソノミーの初期化を追加します。
- Fixed bug of refresh method.
- Overwirting orderby, order improved.(Thanks @newash and @anriettec)
3.0.1 & 3.0.2
- バグの修正
3.0.0
- Support the Custom Taxonomy Order!!
( wp_list_categories, get_categories, the_terms, the_tags, get_terms, get_the_terms, get_the_term_list, the_category, wp_dropdown_categories, the_taxonomies ) - Suuport the sorting in admin UI.
While having sorted, Drag and Drop Sortable Javascript don’t run. - 非公開オブジェクトをサポートする(show_ui = true、show_in_menu = true)
- 日本語翻訳を追加。
2.1.0
- バグを修正: ‘order’または ‘orderby’パラメータを使用するカスタムクエリが優先されます。
- It does not depend on the designation manner of arguments( Parameters ).
( $args = ‘orderby=&order=’ or $args = array( ‘orderby’ => ”, ‘order’ => ” ) ) - 2.0.7, 2.0.8, 2.0.9に存在した不具合が改善されました!
- 2.0.6から2.1.0に更新してください。
2.0.9
- 管理者のパフォーマンスの向上。
致命的なパフォーマンスの問題が大幅に改善されました。 - バグを修正:アタッチメントオブジェクトは壊れていません。
- バグ修正:マルチサイトの警告表示が解決されました。
- Fixed bug: First when enabling items, ‘menu order’ of items are not broken.
- ‘order’または ‘orderby’パラメータを使用するカスタムクエリが優先されます。
2.0.8
- 管理者のパフォーマンスの向上。
リフレッシュ方法(すべてのメニュー順序を再構成する)は、アクティブなオブジェクトのリストページでのみ実行されます。
2.0.7
- バグ修正: WordPress 3.8用
- スウェーデン語の翻訳を追加する(by Thomas)
2.0.6
- ver.2.0.5を修正しました。
2.0.5
- Support ‘next_post_link()’ and ‘previous_post_link()'(single to single).
2.0.4
- バグの修正
2.0.3
- 直感的なCPO設定ページが[設定]メニューに移動しました。
2.0.2
- バグの修正
2.0.0
- ソートする対象を選択します。 (投稿、固定ページ、カスタム投稿)
- 固定ページと階層型カスタム投稿をサポート。
- ソート可能なアイテムのステータスは「公開」だけでなく、他のすべてのステータス(「保留」、「下書き」、「非公開」、「予約投稿」)です。
- In Paging, it’s all activated normaly. So, ‘screen-per-page’ is User like.
- In Lists which sorted any category(Category, Tag, Taxonomy), it’s all activated normaly.
- 子投稿と子固定ページをサポートします。アイテムを並べ替えると、そのアイテム間の親アイテムの関係が維持されます。
1.2.1
- バグを修正しました
1.2.0
- Sortable UI that Visually cleared. (Change cursor, and so on.)
- ソート可能なアイテムは垂直方向にのみドラッグできます。
- クイック編集メニューが有効になりました。
- It is not collapse of the cell widths any more whenever dragging any items.
1.1.1
- バグの修正
1.1.0
- 1画面あたりのページ数は自動的に ‘999’に設定され、未設定よるトラブルを防ぎます。
- ‘get_posts’や ‘query_posts’などで ‘order’または ‘orderby’パラメータを使用するカスタムクエリを除外します。
1.0.0
最初のリリース