Tagged: ajax search
Is it possible to hide certain pages from the ajax search results?
Please let me know if it is and how this can be achieved.
Thanks
Hey IconicD!
You are going to need to use a more advanced search plugin for such feature.
You can try using SearchWP plugin ( you can find implementation here – http://kriesi.at/documentation/enfold/use-searchwp-instead-of-the-standard-search/ ) or Relevanssi plugin ( implementation here – http://kriesi.at/documentation/enfold/use-relevanssi-in-search-instead-of-the-default-search/ )
Cheers!
Yigit
Hey IconicD!
Try opening up /enfold/functions-enfold.php and change line 97 from this.
$defaults = array('numberposts' => 5, 'post_type' => 'any', 'post_status' => 'publish', 'post_password' => '', 'suppress_filters' => false);
To this.
$defaults = array( 'post__not_in' => array( 1, 2, 3 ), 'numberposts' => 5, 'post_type' => 'any', 'post_status' => 'publish', 'post_password' => '', 'suppress_filters' => false);
And change 1, 2, 3 to the IDs of the pages you want to exclude.
EDIT: Oops, looks like we replied at the same time.
Regards,
Elliott
Does this work for hiding pages from the main search page too>
Thanks
Hi,
@tjswarbs78 Yes it should. Please give it a try and start a new thread if that does not work :)
Best regards,
Yigit