The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Simple Page Ordering
Open Order Page by Default for Posts and CPTs (4 posts)

  1. blurby
    Posted 2 years ago #


    Does anyone know if there is a way to open the 'Sort By Order' view by default for posts and custom post types (just like it does for pages)?

    It would be very convenient to work with, especially for those of us that work with a lot of posts/custom posts.



  2. mightypixel
    Posted 2 years ago #

    I managed to get the native support for custom post types (by making them hierarchical), but no luck for the default post type.

    Your ideas are much appreciated. Thanks.

  3. Andrew Tegenkamp
    Posted 2 years ago #

    I use this code to get it working for Pages and Custom Post Types (even if they are not hierarchical but support page-attributes) as this simulates clicking the "Sort by Order" button by default for these page types. I'm not sure what you mean by sorting posts by order since posts do not have order by default or even with this plugin as far as I know.

    function my_default_sort() {
    	//print_r($_GET); //debug to see what you got
    	$post_type = (isset($_GET['post_type'])) ? $_GET['post_type'] : '';
    	if ($post_type) {
    		if ($post_type == 'page' || $post_type == 'custom') {
    			if (!isset($_GET['orderby'])) $_GET['orderby'] = 'menu_order+title';
    	//print_r($_GET); //debug to see what you did
    add_action( 'load-edit.php', 'my_default_sort' );

    Hope that helps!

  4. Eric Andrew Lewis
    Posted 2 years ago #

    I think this is an issue in core. See #26752

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple Page Ordering
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.