Couldn\'t get that plugin to work, but I did fix it by putting this code into my functions.php file...
// Set search results to display only \'product\' post type results
if ( !is_admin() ) {
function searchfilter($query) {
if ($query->is_search && !is_admin() ) {
$query->set(\'post_type\',array(\'product\'));
}
return $query;
}
add_filter(\'pre_get_posts\',\'searchfilter\');
}
Hi there,
Currently when I search for something on my site it brings up all pages, posts, products etc that contain those words.
I'd like to exclude Pages if possible.
How could I achieve this?
Many thanks,
R
Hey ,
You can use this plugin: https://wordpress.org/plugins/search-everything/ .
Thanks
ThemeNectar Support Team
Couldn\'t get that plugin to work, but I did fix it by putting this code into my functions.php file...
Cheers.
ThemeNectar Support Team