0

I'm currently using the menu_order field in the DB to have some custom ordering of posts. I want to expose this field to the user via the admin section, like it is when editing a Page (in Page Attributes).

Is there a simple way to do this?

2 Answers 2

2
<?php
add_action( 'init', 'wpse31629_init' );
function wpse31629_init()
{
    add_post_type_support( 'post', 'page-attributes' );
}

Add that to your functions.php or in a plugin file and you'll get an attributes dialog box with the menu order input.

2
  • @Ben This IS the exact interface you're asking for. Commented Oct 20, 2011 at 16:00
  • This is perfect. Commented Oct 20, 2011 at 16:45
0

This isn't the exact interface you're asking for, but you might like this.

http://drewgourley.com/order-up-custom-ordering-for-wordpress/

It modifies the 'menu_order' field the same way you are, and it also allows you to set an option to auto sort all queries from specific post types, so you don't have to manually set the 'orderby' and 'order' arguments when getting posts.

1
  • Thanks, but I'm doing a lot of custom ordering in code, so I don't want to use a plugin that will mess with that. Commented Oct 20, 2011 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.