• Hello , sorry if my question is rookie question ,

    i have query search like this :

    $args[‘recipes_skill’] = $_POST[“skill_recipes”];
    $args[‘post_type’] = ‘recipes’;
    $args[‘taxonomy’] = ‘category’;
    $args[‘taxonomy_term’] = $thisCat->name;

    $results = $Q->get_posts($args);

    With my code above i get data what i want

    $args[‘recipes_speed’] = $_POST[“speed_recipes”];
    $args[‘post_type’] = ‘recipes’;
    $args[‘taxonomy’] = ‘category’;
    $args[‘taxonomy_term’] = $thisCat->name;

    With my code above i get data what i want… But if i merge custom field recipes_speed & recipes_skill like this :

    $args[‘recipes_skill’] = $_POST[“skill_recipes”];
    $args[‘recipes_speed’] = $_POST[“speed_recipes”];
    $args[‘post_type’] = ‘recipes’;
    $args[‘taxonomy’] = ‘category’;
    $args[‘taxonomy_term’] = $thisCat->name;

    i got 0 data and that is results not i want..

    Any suggestion with my problem ? why when i’m combine 2 custom field i dont get data what i want 🙂

    Thanks Very Much 🙂

    https://ww.wp.xz.cn/plugins/custom-content-type-manager/

Viewing 1 replies (of 1 total)
  • Yea, I’ve been running into this issue also. when I try to query more than one custom field I get 0 results. I’ve had to go back to the older way using wp_query and meta_key/value.

    if I try:

    $Q = new GetPostsQuery();
    $args = array();
    $args[‘post_type’] = ‘video’;
    $args[‘Type’] = ‘Members’;
    $args[‘aws_name’] = ‘whatevername’;
    $args[‘orderby’] = ‘Part’;
    $results = $Q->get_posts($args);

    I get 0 results. I’ve tried this a few times, and get 0 results when using 2 or more custom args to filter results.

    This would be nice and save time because we can use custom field names directly instead of the wp+query, meta key/value technique

Viewing 1 replies (of 1 total)

The topic ‘Search With Multiple Custom Field’ is closed to new replies.