Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Multisite Search › Reply To: Multisite Search
May 3, 2022 at 2:53 pm
#37703
Participant
Hi,
Thanks so much for the code, but unfortunately it does not seem to be working. Im not getting any errors but its still showing other categories.
I did minor changes to the code:
add_filter("asp_query_args", "asp_query_args_change", 10, 2);
function asp_query_args_change($args, $search_id) {
$include = array(
// Blog ID => Taxonomy term ID
1 => 269
);
if ( isset($include[get_current_blog_id()]) ) {
$args['post_tax_filter'] = array(
array(
'taxonomy' => 'listing_location',
'post_type' => 'listing',
'include' => array($include[get_current_blog_id()]),
'exclude' => array(),
'allow_empty' => false // Don't allow results, which does not have connection with this taxonomy
)
);
}
return $args;
}
i think i did it right based on this: wp-admin/edit-tags.php?taxonomy=listing_location&post_type=listing
And this is the link to that category: search/?postType=listing&listing_location=268
Any help would be greatly appreciated.
Thanks so much!