I've got this theme where you can add posts of type "portfolio", and I want to be able to reorder them up. I've added a custom meta field called "position" and I've set already those values. All good.
My question is: How can I modify the query to join the wp_postmeta table and order them by the "postion" value?
This is the current query:
$loop = new WP_Query( array(
'post_type' => 'portfolio',
'posts_per_page' => $homepagenumber
) );
I really appreciate any hint on this. Thanks a lot.
