Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Problem with multisite? › Reply To: Problem with multisite?
March 21, 2014 at 9:18 am
#1473
It depends on various things, but the id is not really predictable.
If you use only one search for each blog and the same template for all the sites, then editing the search shortcode is most likely the best solution for you.
Open up the plugins/ajax-search-pro/includes/shortcodes.php and go to line 88:
$search = $wpdb->get_results("SELECT * FROM ".$_prefix."ajaxsearchpro WHERE id=".$id, ARRAY_A);
and change this line to:
$search = $wpdb->get_results("SELECT * FROM ".$_prefix."ajaxsearchpro", ARRAY_A);
plus add this line after line 99:
$id = $search[0]['id'];
This change in the shortcode will generally ignore the search id and selects the first one found on each sub-site. Now you can use the same template for each site with any search shortcode, like:
<?php echo do_shortcode('[wpdreams_ajaxsearchpro_results id=0 element="div"]'); ?>
because the id doesn’t matter anymore.
Best,Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
![](https://wp-dreams.com/assets/envato/comment-button-knowledgebase.png)
![](https://wp-dreams.com/assets/envato/comment-button-support.png)
![](https://wp-dreams.com/assets/envato/comment-button-facebook.png)
![](https://wp-dreams.com/assets/envato/comment-button-twitter.png)