wp_query ordered by custom field value
-
Hi everyone, I am using in my portfolio the following wp_query:
<?php $loop = new WP_Query( array( 'post_type' => 'work', 'posts_per_page' => 999, 'order' => DESC ) ); while ( $loop->have_posts() ) : $loop->the_post(); ?> .....
And it’s working perfectly, what I want is to order by “Year” Custom Field Value, of course is a numeric value such as: 2001, 2007 or 2010.
How can I do it?
Thanks in advance!
Best regards.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wp_query ordered by custom field value’ is closed to new replies.