Support

Account

Home Forums General Issues Query date repeater field

Solving

Query date repeater field

  • Hi

    i try to get all the post where the date (first act field defined in repeater) is equal to february (02), i do this, could you helped me please..?

    my date field : dates_0_date_spectacle returns dd/mm/yy, so i try to isolate mm to compare with actual month

    thanks

    query_posts(
    $query_string .'&post_type='.$post_type.
    '$meta_query=array(array('.
    '$key='.substr(get_field('dates_0_date_spectacle',3,2)).
    '$value=02'.'&compare==' )
  • i tried like this, to try to display only if one post has the same date than today date but i ‘ve all the post instead of only one.

    $today = date(“d/m/Y”);
    $args = array (
    ‘post_type’ => ‘spectacle’,
    ‘meta_key’ =>’dates_0_date_spectacle’,
    ‘orderby’ => ‘meta_value_num’,
    ‘meta_value’ => $today,
    ‘meta_compare’ => ‘=’,
    );

  • does not work too…

    $args = array (
    ‘post_type’ => ‘spectacle’,
    ‘meta_key’ => ‘dates_0_date_spectacle’,
    ‘meta_value’ => ’05/02/2015′

    );

    ////
    echo get_field(‘dates_0_date_spectacle’) -> 05/02/2015

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Query date repeater field’ is closed to new replies.