Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 1 down vote accepted
<?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.

share|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.

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.

share|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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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