if ( !is_admin() ) {
add_filter('pre_get_posts','searchfilter');
function searchfilter($query) {
if ($query->is_search && !is_admin() ) {
$query->set('post_type',array('product'));
}
return $query;
}
}
if ( !is_admin() ) {
add_filter('pre_get_posts','searchfilter');
function searchfilter($query) {
if ($query->is_search && !is_admin() ) {
$query->set('post_type',array('product'));
}
return $query;
}
}
Leave a Reply