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?

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.

| improve this answer | |
  • @Ben This IS the exact interface you're asking for. – Drew Gourley Oct 20 '11 at 16:00
  • This is perfect. – Benjamin Greenberg Oct 20 '11 at 16:45

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


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.

| improve this answer | |
  • 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. – Benjamin Greenberg Oct 20 '11 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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