• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Notes to Self

  • Aviation Weather from NOAA Plugin
    • KZZV
    • Bad Shortcode
    • Simple Metar
  • Meetings
  • Meetings Map

Mark Chouinard / May 30, 2013

Simple Post Ordering +1 for Jake!

I absolutely love this plugin!  I’m putting the faq here for my own use, but if anyone else reads this, I highly recommend this plugin.

[hr][hr]

Why can’t I reorder my posts?

Generic posts are not displayed by menu order – they’re displayed by chronology. You can theoretically add menu ordering to posts in your code (theme functions.php, plug-in) by using:

add_post_type_support( 'post', 'page-attributes' );

Can I make my custom post type take advantage of this plug-in?

Yep. There are two ways to turn on support for Simple Page Ordering.

Ideally, when you register the post type, set hierarchical to true – hierarchical post types natively order by menu order.

Alternatively, when you define the features the post type supports, include page-attributes. This will add a Sort by Order option to the filter links above the drop downs. Once you sort by order, you can drag and drop the content.

Finally, you can take advantage of the

simple_page_ordering_is_sortable

filter, which passes the result of the default check and the post type name, to override default behavior.

I want my non-hierarchical post type to be sortable. Help!

See the previous two answers – just add

page-attributes

to the list of supported post type features.

I reordered my posts, but the order didn’t change on the front end of my site!

This plug-in doesn’t change any behavior on the front end, it simply changes the menu order stored in WordPress.

If you want a list of pages or custom post types to display in that defined order, you must change the post query’s orderby parameter to menu_order (if it’s not already).

I reordered my content, it seemed to work, but when I refreshed, it went back to the old order!

This most likely means the AJAX request – the server side code – failed after you dropped the content into the new position. Some shared hosts aggressively time out and limit AJAX requests. Version 2.0 batches these requests so you can try reducing the number of items it updates on each request using a filter in your theme’s functions.php or a custom plug-in:

add_filter( 'simple_page_ordering_limit', function($number) { return 5; } );

Where 5 is the number of items to batch on each request (the default is 50). Note that this example uses PHP 5.3+ callback functions, so if you’re still on PHP 5.2, you’ll need to add a traditional callback.

What happened to the drop down box that let me change the number of items on each page in the admin??

This feature is already built into WordPress natively, but a bit tucked away. If you pull down the “Screen Options” tab up top (on the list of post objects) there’s a field where you can specify the number of items to show per page. I decided it was not a very good practice to duplicate this.

Filed Under: WordPress Tagged With: post order

Primary Sidebar

Footer

Copyright © 2021 · machouinard · Log in