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

Reply To: Not all blogs are appearing on Multisite Blog Query

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Not all blogs are appearing on Multisite Blog Query Reply To: Not all blogs are appearing on Multisite Blog Query

#36847
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

Thank you for the details, it helps us a lot!

For the blogs list, I made a correction via FTP, can you please confirm that all blogs are listed now? If so, then I will make sure integrate this patch in the next release.

As for the categories, well there might be a way. It is not to prevent them from the search, but rather “remove” the ones from the results after the search is completed via a custom code.

Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

add_filter( 'asp_results', 'asp_custom_remove_results', 10, 1 );
function asp_custom_remove_results( $results ) {
	foreach ($results as $k=>&$r) {
		if ( $r->content_type == 'term' && $r->blogid != get_main_site_id() ) {
			unlet($results[$k]);
		}
	}

	return $results;
}

This will check against each category type of result, if the source blog ID is the main site, and if not, then removes it.