This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Multisite Search #37703
    SittingduckSittingduck
    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!

    in reply to: Multisite Search #37626
    SittingduckSittingduck
    Participant

    Awesome! Thank you so much! i will try it and let you know if it worked.

    in reply to: Multisite Search #37602
    SittingduckSittingduck
    Participant

    Hi,
    Thank you.
    Well actually all subsites will be only searching the main site and not each other. So we basically have company listings on the main site, and we have subsites based on country. So i would want the USA subsite to only search the main site within the USA category. Would this be possible?
    Thanks so much!

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