WordPress custom meta query
-
Hey guys,
I have been strugguling days and days with custom querys, I have client who has a travel agency website and they need to display their so called travel offers on the site. Now they have a custom meta field called reisialgus (travelstart), that meta field contains date in format dd/mm/yy.
I need to sort it by date. Unfortunately it does not work as it should 🙁
Can you tell me if there is something I’m doing wrong…
<?php $args = array(
‘posts_per_page’ => 50,
‘orderby’ => ‘reisialgus’,
‘order’ => ‘ASC’,
‘meta_key’ => ‘reisialgus’,
‘post_type’ => ‘post’,
‘post_status’ => ‘publish’,
‘suppress_filters’ => true );$the_query = new WP_Query($args);
if( $the_query->have_posts() ): ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>Cheers,
Ivar
The topic ‘WordPress custom meta query’ is closed to new replies.