Intuitive Custom Post Order

Overview

Intuitive Custom Post Order

Intuitively, order items( Posts, Pages, ,Custom Post Types, Custom Taxonomies, Sites ) using a drag and drop sortable JavaScript.

Select sortable items from ‘Intuitive CPT’ menu of Setting menu in WordPress.

In addition, You can re-override the parameters of ‘orderby’ and ‘order’, by using the ‘WP_Query’ or ‘pre_get_posts’ or ‘query_posts()’ or ‘get_posts()’.

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.