question about wordpress WP_Query:
‘post_type’ => ‘event_date’ outputs dd/mm/yy ex: 31122012
I would like to order my frontend ‘event_date’ output not by latest WP post entry
but by latest ‘event_date’
Already tried ‘order’ => ‘ASC’ that sort only on WP post entry
Heres my code:
$arg = array('post_type' => 'livedates');
$the_query = new WP_Query($arg);
while($the_query->have_posts()) : $the_query->the_post();
$date = str_split(get_post_meta($post->ID, 'event_date', true), 2);
//the loop
endwhile;
You can sort a query by a specified post meta field as a number or as a text field.
Example: