Intuitive Custom Post Order

Overview

Intuitive Custom Post Order

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’.

Usage

1. Select Sortable Items.

Admin UI › Settings › Intuitive CPO

2. Order items.

Reorder Posts(Post, Page, Custom Post Types).

Reoder Categories(Category, Tag, Taxonomy).

Details

Support Paging

For example, if you change the order of posts, it does not affect the order of the previous page and next page.
Only the order of the selected posts will be changed.

Support (Category) Sorting

If you change the order of posts in the category sorted state, it does not affect the order of the hide posts.
Only the order of the selected posts will be changed.

Support Hierarchical Post Types

You can change the order of hierarchical posts.
When you drag-and-drop the parent post, it looks like child posts does not follow, and then follow neat if you reload.

FAQ

How to re-override the parameters of ‘orderby’ and ‘order’.

Sub Query

› WP_Query

<?php $query = new WP_Query( array( 'orderby' => 'date',
	'order' => 'DESC',
) ) ?>

› get_posts()

<?php $query = get_posts( array( 'orderby' => 'title',
) ) ?>

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’.

<?php $query = get_posts( array( 'orderby' => 'default_date',
	'order' => 'DESC',
) ) ?>

Main query

Use the ‘pre_get_posts’ action hook or ‘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.

Go to “screen options” and change “Number of items per page:”.

Download

You can download the latest version and older versions from WordPress.org.

This Plugin published on GitHub.

Intuitive Custom Post Order needs your support.

If you enjoy using Intuitive Custom Post Order and find it useful, please consider making a donation.
Your donation will help encourage and support the plugin’s continued development and better user support.




Comments

  • 藤本 陽介 より:

    Intuitive Custom Post Orderを使わせていただきました。開発いただきありがとうございます。
    質問させていただきたいのですが、管理画面上でタグの表示順はドラッグドロップで変更できることを確認しておりますが、ウィジェットエリアでの『タグクラウド』の表示順は変更できないようです。
    ウィジェットエリアの『カテゴリ』は変更できるのですが、『タグクラウド』は対象外なのでしょうか?
    お忙しいところ恐れ入りますが、ご確認いただけますと幸いです。

  • Jeroen Schoonderbeek より:

    the plugin is no longer compatible with version 3,8+ get_screen_icon() function is deprecated

  • Kat より:

    Hello,

    Downloaded the plugin and was able to move my portfolio pages, but those changes does not appear on the website itself (homepage). The site is goo.gl/CR7cWt. Any idea where the problem might be? Thank you!

  • Y より:

    こちらのプラグイン便利に使わせていただいています。ありがとうございます。
    1点ご報告とご相談なのですが、記事の並び替えが一部反映されなくなる現象がありました。
    ドラッグアンドドロップでの見た目上の並び替えはできるのですが、リロードすると並び替え前の状態に戻ってしまいます。(サイト上も反映されません。)
    データベース内を確認してみると、menu_orderの値が重複しているものがあるようで、重複している記事同士だと並び替えができないようでした。
    WordPressの4.9.1、プラグインは3.1.0で確認しています。
    お手数をおかけいたしますが、この問題の解消方法をご教授いただけないでしょうか。
    よろしくお願いいたします。

  • Eri Nagira より:

    お客様に操作していただくのに直感的に出来るので、大変ありがたく使わせていただいております。
    さて一つ現象についてご相談なのですが、投稿一覧の一番下にある記事を動かそうと思っても動かない現象を確認いたしました。
    おそらくその上の記事数件も動かないようです。(上の方にあるものは動くのですが。)
    Wordpressのバージョンは4.9.1です。ご多用のところ申し訳ございませんが、解決方法または確認いただける機会ございましたらお調べいただけましたら幸いです。よろしくお願いいたします。

    追記です。 動かないエリアの記事を、動く辺り(一覧の上の方)まで一旦持ち上げて入れてから移動させると動きました。

    • hijiri より:

      報告ありがとうございます。
      最下部付近のエリアで、ドラッグできるけどドロップができないということになりますでしょうか?
      こちらでは再現性が確認できませんでした。
      一覧に表示する件数が多い時に発生するなど、その他条件など思い当たるところはありますでしょうか?

      • Eri Nagira より:

        ご返信遅くなりまして申し訳ございません。

        >ドラッグできるけどドロップができないということ
        そうです。最下層のものを、すぐ上の記事と入れ替えようとした時に起きた現象です。20件表示のときに6件程度上までドラッグして持っていき任意の場所へ下ろすと入りましたので、特段今のところ支障はでていませんが。

        表示件数が20件や70件の時にも事象が出ていました。

        当方現象を確認したブラウザはChrome63.0.3239.84(Windows10)です。

  • Eri Nagira より:

    お客様に操作していただくのに直感的に出来るので、大変ありがたく使わせていただいております。
    さて一つ現象についてご相談なのですが、投稿一覧の一番下にある記事を動かそうと思っても動かない現象を確認いたしました。
    おそらくその上の記事数件も動かないようです。(もっと上の方にあるものは動くのですが。)
    Wordpressのバージョンは4.9.1です。ご多用のところ申し訳ございませんが、解決方法または確認いただける機会ございましたらお調べいただけましたら幸いです。よろしくお願いいたします。

  • twistedroute より:

    Hi, there is a bug in the plugin on line 614, in hicpo_pre_get_posts function. You are checking for is_admin and you have left out the possibility of someone trying to show posts using ajax or use some filtering ajax tool. The issue that when you hit admin-ajax.php is admin is always going to be true and trying to load posts with different order results in you always overwriting the main query. So please push a new version of the plugin where you change the if statement form “if ( is_admin() )” to “if ( is_admin() && !wp_doing_ajax() )”

    Thanks!

  • dobin より:

    はじめまして
    ワードプレス4.9では未対応のようですが
    ワードプレス4.9では動作しませんでした。
    バージョンアップはいつごろになりそうですか?

  • 近藤有道 より:

    スマホやタブレット等のタッチデバイスでも機能するようには出来ないのでしょうか?
    現状PCでしか並べ替え出来ないので、困っています。

  • disctest より:

    WP4.8へアップデートし、こちらのプラグインも最新へアップデートしました。
    その後、メデイアライブラリを開くとクルクルのアイコンが回りっぱなしになってしまいうまく動きません。こちらのプラグインを無効化すると直るのですが、、、

    • hijiri より:

      再現性が確認できませんが、プラグインを最新版(v3.1.0)にアップデートしてみるといかがでしょうか?

  • Lorenzo Puliti より:

    Hi, I would need to reorder posts in tag archives too, is it possibile to do it with this plugin?

  • Gavin Klose より:

    Hi. We love your plugin. But we are finding it clashes with WP RSS Aggregator. When posts are fed in by RSS Aggregator some older existing posts appear above the newer fed posts when your plugin is activated. As soon as the plugin is deactivated the correct order is displayed.

    Is this a known issue? Is there an easy fix? If so we would like to pay you for it.

  • Musanete Sakupwanya より:

    Hey! I like the idea of your plugin, for use with my one page format..
    But the plugin isn’t showing up in my settings. Any way I can troubleshoot this?
    I have 3.0.7

  • Masahiro より:

    はじめまして。
    こちらのプラグインが大変便利で助かっています。ありがとうございます。
    1点質問なのですが、複数カテゴリーが選択された場合の挙動です。
    複数カテゴリーを選択した場合は、カテゴリー毎には並べれないのでしょうか?
    プラグインは最新版を利用しています。よろしくお願いします。

    • hijiri より:

      “複数カテゴリーが選択された場合”というのはフロント側の話でしょうか?
      具体的なテンプレの記述を教えていただけますか?

  • 鈴木 より:

    素晴らしいプラグインを開発して頂きまして有難うございます。
    大変重宝させて頂いております。

    get_posts() で、order,orderby が無視されてしまう現象が起きております。
    最新版(バージョン 3.0.7)を利用させて頂いております。

    何か解決策などございますでしょうか?

    $args = array(

    ‘numberposts’ => ‘-1’,
    ‘post_type’ => ‘page’,
    ‘order’ => ‘DESC’,
    ‘orderby’ => ‘date’,
    ‘tax_query’ => array(

    array(

    ‘taxonomy’ => ‘page_no_category’, //カスタムタクソノミー
    ‘include_children’=>false,
    ‘terms’ => array( ‘reading’ ),
    ‘field’ =>’slug’,

    )

    )

    );

    • hijiri より:

      説明文にも記載させていただいておりますとおり、仕様上 get_postsはサポート外とさせていただいております。サブクエリを発行する際は WP_Queryオブジェクトを使用するようにお願いします。

      • 鈴木 より:

        ご返信ありがとうございます。

        説明を熟読できておらず申し訳ありませんでした。

  • Kenny より:

    Hi, this is a useful plugin. While I activated this plug-in, the WordPress gallery does not work properly. The image cannot be shown. Please help to fix. Thank you.

  • Grant より:

    Hi, I just installed it in Event Espresso and it allows me to move items but when I hit APPLY they revert back. I’m wondering if it is because it is in a sub -directory eg directory = SPONSORS, sub-directory = TIERS. Tiers does not show on the INTUITIVE CPO SETTINGS. Any ideas? Thanks

  • Gavin Klose より:

    BTW: we have some hack code that might help which fixes the problem (Posts in default order in RSS feed code) but causes other ones 😉

  • Gavin Klose より:

    The plugin does not create a RSS feed code that has the posts in the re-aaranged order.

    Our blog is fed into other blogs but also into Campaign Monitor as RSS-to-Email campaigns but it is displaying in the default date order.

  • inocchi_68 より:

    こんにちは。プラグイン便利に使わせて頂いてます。ありがとうございます。

    1つ質問させて下さい。
    新着情報ページを制作したいのですが、
    『PHP Code for posts』プラグインを入れて固定ページにPHPを書けるようにし、
    下記のコードを入れたですが、更新順にならず、
    『Intuitive Custom Post Order』の並び順が優先されてしまいました。
    phpファイルに書いた時も同様でしたが、書き方が間違っていますでしょうか?
    「numberposts」は効いているのですが…よろしくお願いいたします。

    ‘modified’,
    ‘order’ => ‘DESC’,
    ‘numberposts’ => ’20’,
    );
    global $post; $lastposts = get_posts( $args ); //表示件数とカテゴリID
    foreach($lastposts as $post) :
    setup_postdata($post);
    $post_title = $post->post_title;
    if(mb_strlen($post_title)>40) { //記事タイトルの文字数
    $post_title = mb_substr($post_title,0,40).’…’;
    }
    ?>

    post_date)); ?>

    $diff1){
    echo’New!’;
    }
    ?>
    <a href="” id=”post-“>  ご参加いただきました。

    • inocchi_68 より:

      すみません、コードが切れてしまいました。

      ‘modified’,
      ‘order’ => ‘DESC’,
      ‘numberposts’ => ’20’,
      );
      global $post; $lastposts = get_posts( $args ); //表示件数とカテゴリID
      foreach($lastposts as $post) :
      setup_postdata($post);
      $post_title = $post->post_title;
      if(mb_strlen($post_title)>40) { //記事タイトルの文字数
      $post_title = mb_substr($post_title,0,40).’…’;
      }
      ?>

      post_date)); ?>

      $diff1){
      echo’New!’;
      }
      ?>
      <a href="” id=”post-“>  ご参加いただきました。

      • inocchi_68 より:

        すみません、自己解決いたしました!
        <?php の下に下記を入れたら直りました。
        お騒がせ致しましたm(__)m
        global $args;

  • acl_kurosuke より:

    操作がシンプルでとても使いやすく気に入って使用させていただいております。
    ありがとうございます。
    最近1点だけ問題が発生しておりますので、ご質問させていただきます。

    テーマのindex.php または index.php に呼び出されているheader.php 等の中で
    $args = array(
    ‘category_name’ => ‘about’, ‘orderby’ => ‘date’,
    ‘order’ => ‘desc’
    );
    $the_query = new WP_QUERY($args);
    のように日付順に並べた場合に、プラグインのソートが優先されてしまう問題が発生しています。
    カテゴリー等に同じ記述をした場合、問題は発生しません。
    回避策などありましたらご教示いただけますと幸いです。
    どうぞよろしくお願いいたします。

    • hijiri より:

      検証いたします

      • acl_kurosuke より:

        ありがとうございます。再現に何か必要な情報などございましたらお知らせください。幸い index.php では投稿をカスタム順にする必要が無かったため、ホームのみプラグインを切って対応しています。

    • TDDK より:

      当方も同様の症状です。
      当プラグインを有効化するとsidebar.phpの下記記述が無視されてしまいます。

      $args = array(
      ‘posts_per_page’ => 1,
      ‘post_type’ => ‘hogehoge’,//カスタムポストタイプ名
      ‘orderby’=>’meta_value’,
      ‘order’=>’ASC’,
      ‘meta_key’=>’fugafuga’,//ソート対象のカスタムフィールド名
      ‘meta_query’ => array(
      array(
      ‘key’ => ‘fugafuga’,//ソート対象のカスタムフィールド名
      ‘value’ => time(),//fugafugaはunix時間を入れたものなので。。
      ‘compare’ => ‘>=’,
      ),
      ),
      );
      $the_query = new WP_Query($args);

      このうち posts_per_page や post_type は効くのですが、order や meta_query は効いていないです。
      お忙しい事とは存じますが、何卒ご検討のほど、よろしくお願い致します。

  • またはDisqusに登録してください より:

    Hello Hijiri,
    Your plugin is very useful however it is interfering with the standard WP galleries. It becomes impossible to manually sort the photos once the plugin is activated. Is it possible to fix it?
    I’m using WP 3.9
    Regards,
    Fonda61

  • sgrasso2012 より:

    I too just rolled back to ver.2.0.6. The latest version was not working correctly. On a good note, ver.2.0.6 works great and has helped our site very much with our vendors.

  • Yo Yamamoto より:

    はじめまして、Yamamotoと申します。素的なプラグインをありがとうございます。
    WP Custom Searchプラグイン使用の検索結果ページ(テンプレートsearch.php)において、wp_nav_menu();で’menu’ => ”を指定しても、指定したメニューが出力されない問題に遭遇いたしましたのでご報告いたします。

  • tazaki より:

    はじめまして。使いやすそうなのでインストールしてみました。そこで質問です。記事の順番をコントロールするにはタイトルにpost1とかpost2とかいう名前にしないとダメなのでしょうか?

  • leo より:

    This plugin work good, but is possible get a query based in the order according you ICPO plugin and not as las date?….

    • Leo より:

      more notes: Because in some query from posts or custom post type posts, the posts are sorted by date, and will be good that this action be done by default making the drag and drop according the plugin… have more sense, thanks!

  • Gavin Klose より:

    Can you please send a version of 2.0.6 of Intuitive CPO for us to use as 2.0.7 and 2.0.8 are not working but we LOVED 2.0.6. Please see our and other support tickets for details (about the reverse order issue).

  • taro より:

    初めまして!大変すばらしいプラグインを大活用させて頂いております。
    1点だけ気づいたことがあったのですが、公開ページ側のサイドバーウィジェットすべてが
    古い日付順で並んでしまいます。

    こちらのプラグインを停止すると、通常の最新日付順で表示されます。
    何かしら影響しているのかなと思い質問させていただきました。

    私の環境だけかもしれないのですが、ご確認いただければと思います。
    よろしくお願いします。

    • hijiri より:

      使用されているウィジェットを教えていただけますか?
      検証致します。

      • taro より:

        こんにちは。上記で記述した現象ですが、私が購入した有料テンプレートの「最近の投稿」ウィジェットで影響が見られるようです。なお、このウィジェットは販売者のカスタム版でした。

        ワードプレス標準の「最近の投稿」ウィジェットでは日付は新しい順で表示されております。

        ですので、こちらのプラグインが不具合となるようなことはありませんでした。
        「Intuitive Custom Post Order」と有料テンプレート、お互いの仕様がぶつかってしまう部分がある、ということで納得しようと思っております。

        テンプレート側のサポートにも問い合わせをして部分修正をしてもらったのですが、やはり仕組み上どうしても「Custom Post Order」との同時運用が難しいかもです。

        ということで、ワードプレス標準のウィジェットでは特に問題は起きていないと思います。
        何か不具合要因があるかのような記述をして申し訳ありませんでした。

        • hijiri より:

          報告ありがとうございます。
          WordPress標準のウィジェットについて検証しておりますので、サードパーティ製のウィジェットについてはサポート外とさせていただきます。ご了承ください。

  • ななふし より:

    こんにちは。素晴らしいプラグインをありがとうございます。
    今回のバグフィックスで更に良くなりました!

    ちなみに私がフィックス前のバージョンで遭遇したバグは
    ver3.8において、get_posts()のパラメータ、post_typeにarrayでカテゴリーを渡して出力処理をした際に管理画面の順序指定ならびにorderby、orderの指定が無視され、古い順に並んでしまう、というバグでした。
    似た例も見当たらず、どうしたものかな、と思っていた矢先の修正だったのでとても助かりました!

  • tiger より:

    こんにちは。こちらのプラグイン最高です。まさに必要なものでした。
    wordpressのバージョンを3.8に上げてしまったのですが、反映されなくなり、順番替えも効かなくなってしまいました。おそらくバージョンアップが原因かと思うのですが、どうにか対応が可能でしょうか。よろしくお願いします!!!

    • hijiri より:

      確認します。
      少々お待ちください。

      • tiger より:

        お返事ありがとうございます。
        お手数おかけいたしますが、また利用できる様になるのを楽しみにしてますっ!

        • hijiri より:

          ver.3.8で確認したところ、不具合の再現性は確認できませんでした。
          詳細を教えていただけないでしょうか?よろしくお願いします。

          • tiger より:

            ご確認ありがとうございました!!!
            そうなんですね、、以下詳細です。

            ・管理画面、ドラッグで順替えは可能→更新F5→管理画面上は順替え反映されてます。
            ・固定ページにwhileで並べているのですが、どうも並び順が単純に投稿日時の逆(古いものが上)に並ぶ感じです。
            ・ドラッグで替えた順は、その固定ページでは反映されず(日付逆のまま動かず)

            です。

            何かこちらの他のプラグインや自作の何かが影響してるのかもです。
            また、心当たりもバージョン3.8のタイミングだとは思うのですが、気づいたのがそのタイミングだったのかもしれないです。。
            急いではいませんので、また何か解った時はぜひ教えてください。

          • nipper_onside より:

            WordPress 3.8にアップデートしたタイミングで同じような現象がありましたので、参考までに…

            カスタム投稿タイプ → 問題なく動作してます
            固定ページ → tiger さんと同じような症状

            並び順を orderby = menu_order と指定して解消しました。
            基本的に order や orderby を指定しなくても管理画面の並び順が反映され、order や orderby を指定するとそちらが優先されるという認識であってますよね。

          • hijiri より:

            バグフィックスしてver.2.0.7にアップデート致しました。
            ご迷惑おかけしました。

コメントを残す