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 thought this would be a simple task, but I cannot find anything on google.

I would simply like to echo the meun_order value in my loop.

I tried this but it's not in the post_meta table, its in the post's table.

<?php echo get_post_meta($post->ID, 'menu_order', true); ?>

Can anyone help please?

Thanks Josh

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can't use get_post_meta since the menu_order is stored in the posts table, like you said. But you can set up an easy database query to get the value.

$menu_o = $wpdb->get_var( "SELECT menu_order FROM $wpdb->posts WHERE ID=" . $post->ID  );
echo $menu_o;
share|improve this answer
    
perfect dude, thanks so much for sharing. –  Joshc Jan 23 '13 at 14:21

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.