Forums Forums Search & Filter Pro Outputting filtered results question, how?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Anonymous
    #252876

    This is the result of the GET
    Array ( [_sfm_condition] => Used [_sfm_fuel] => Diesel [_sfm_loa_feet] => 0 100 [_sfm_price] => 0 150000 )

    This is the stringvars after converting the between value (ignore -)
    Used – Diesel – 0,100 – 0,150000

    This is the result of the args
    Array ( [meta_query] => Array ( [relation] => AND [0] => Array ( [key] => condition [value] => Used [compare] => = ) [1] => Array ( [key] => fuel [value] => Diesel [compare] => = ) [2] => Array ( [key] => loa_feet [value] => Array ( [0] => 0,100 ) [compare] => BETWEEN ) [3] => Array ( [key] => price [value] => Array ( [0] => 0,150000 ) [compare] => BETWEEN ) ) )

    this is the args construct
    $args = array(
    ‘meta_query’ => array(
    // ‘post_type’ => ‘post’,
    // ‘category’ => 1165,
    ‘relation’ => ‘AND’,
    array(
    ‘key’ => ‘condition’,
    ‘value’ => $condition,
    ‘compare’ => ‘=’
    ),
    array(
    ‘key’ => ‘fuel’,
    ‘value’ => $fuel,
    ‘compare’ => ‘=’
    ),
    array(
    ‘key’ => ‘loa_feet’,
    ‘value’ => array($nloa),
    ‘compare’ => ‘BETWEEN’,
    ),
    array(
    ‘key’ => ‘price’,
    ‘value’ => array($nprice),
    ‘compare’ => ‘BETWEEN’,
    ),
    // ‘key’ => ‘price’,
    // ‘orderby’ => ‘meta_value_num’,
    // ‘order’ => ‘DESC’
    )
    );
    but even though in the search terms I am effectively asking for ‘give me everything’ (all test data is used and diesel currently)

    $custom_posts = get_posts($args);
    returns
    Array()

    I have used DRY in that I am re-using the default layout list code as in
    foreach($custom_posts as $post) : setup_postdata($post);
    and in there I am using ACF as in the_field(‘condition’) for data output

    BUT even sending the form result to a different page it looks like
    $custom_posts = get_posts($args); isn’t working?

    Hope you can shed some light on what is going on here

    Trevor
    #252879

    Hi

    I am not too sure what you are asking me. Our plugin does not use wp_query to fetch posts, other than to process the form filters, work out which Post IDs are needed, and then it asks for those posts using a simplified wp_query that has posts__in as its argument (a long string of the matching Post IDs). We do not use an array of arguments.

    Anonymous
    #252883

    Please point me to the documentation where I can

    a) process the form filter results
    b) use the simplified wp_query with posts__in
    c) how to list out each post id using ACF field references

    Thanks

    Trevor
    #252888
    This reply has been marked as private.
    Anonymous
    #252890
    This reply has been marked as private.
    Anonymous
    #252892
    This reply has been marked as private.
    Trevor
    #252894
    This reply has been marked as private.
    Trevor
    #252899
    This reply has been marked as private.
    Trevor
    #252922
    This reply has been marked as private.
Viewing 9 posts - 1 through 9 (of 9 total)