Search exclude
Hello, i would like to exclude any sites from the search function.
How can i exclude sites in the frontend? I use the plugin "search exclude from roman pronskiy" but i can see the sites in the frontend after i hide the site.
Only in the backend i can not see the exclude sites if i search for.
Please can you help me?
Thank you.
Comments
Hi,
What you ask for requires file customization, which in reference to Item Support Policy, is not allowed. http://themeforest.net/page/item_support_policy
So if you want to modify files and don't know how, you should contact your web developer. Item Policy says:
Item support does not include services to modify or extend the item beyond the original features, style, and functionality described on the item page. For customization services that will help you tailor the item to your specific requirements, we recommend contacting the author to see if they privately offer paid customization services or checking out the great service providers on Envato Studio.
Thanks
Ok. than i use no plugin to do this.
I use a code in my functions.php to exclude any sites.
but i can not exclude that. Do you now why?
/* SITE EXCLUDE FROM SEARCH */
function js_search_filter( $query ) {
if( $query->is_search() ) {
$query->set('post__not_in', array(5143,5144,5150,5151) );
}
return $query;
}
add_action( 'pre_get_posts', 'js_search_filter' );
Sorry, but we do not provide help with file customization.
Please get in touch with your web developer in that case.
Best regards