Support

Account

Home Forums Front-end Issues query by date Reply To: query by date

  • Hi Elliot
    Thanks first for the outstanding support.
    I’m going to check that out soon and let you know.

    For the meantime i got a workaround with an if statement. That might not be the most beautiful solution, but it works temporarely:

    `<?php $args = new WP_Query(
    array(
    ‘post_type’ => ‘chuchi_event’,
    ‘meta_key’ => ‘event_datum’,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => ‘dsc’,
    ‘posts_per_page’ => 50,

    )); ?>

    <?php while($args->have_posts()) : $args->the_post(); ?>

    <?php
    $datex = strtotime(date_format(date_create(”.get_field(‘event_datum’).”),’d-m-Y’));
    $now = time();
    ?>

    <?php
    if($now <= ($datex+(60*60*24))){
    ?>
    <div>
    </div>
    <?php
    }
    ?>

    <?php endwhile; ?>