How to order post by date > custom meta !
-
Hi guys,
I explain my little problem.
I have 2 custom meta one for the start date of my event et one for the end date of my event and I need to order my events according to the start date and to remove them when the end date is over.
Meta:
Start date: date_de_levenvement
End date: date_de_finHere is my loop:
<?php query_posts( 'post_type=agenda&meta_key=date_de_fin&meta_compare=>=&meta_value=' . $todaysDate . '&orderby=meta_value&order=ASC'); ?> <?php while ( have_posts() ) : the_post(); ?> <?php $date = get_field('date_de_fin'); $newDate = date("d/m/Y", strtotime($date)); ?>
Just need to change the query but I don’t know how to use 2 parameters with the meta value.
Thanks a lot,
Jhon
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to order post by date > custom meta !’ is closed to new replies.