Support

Account

Home Forums General Issues If get_fields is empty not working Reply To: If get_fields is empty not working

  • $query_array = array(
       'post_status'    => 'publish',
       'post_type'      => 'show-item',
       'posts_per_page' => $params['number_of_items'],
       'meta_key'	    => 'date_de_debut',
       'orderby'	    => 'meta_value',
       'order'          => $params['order']
    );

    This code works well. The only problem is that the order posts does not match the criteria so it returns: no post match your criteria.

    I just need to change the orderby and the meta_key if get_field(‘date_de_debut) is not empty