How to filter my search in post if contains a word in title, content or excerpt?
Well, for whoever went under the same question, I found the solution: I’ve changed the filter and looks like this now: add_filter( ‘posts_where’, ‘general_filter’, 10, 2 ); $posts = new WP_Query($args); remove_filter( ‘posts_where’, ‘general_filter’, 10, 2 ); and the function… function general_filter( $where, &$wp_query ) { global $wpdb; if ( $search_term = $wp_query->get( ‘search_prod_title’ ) … Read more