WP_User_Query search with multiple search queries

Is it possible to perform a WP_User_Query with multiple search queries? Something like: $args = array ( ‘search’ => ‘*example.com OR *abc.com’, ‘search_columns’ => array( ‘user_email’ ) ); or $args = array ( ‘search’ => array( ‘relation’ => ‘OR’, array( ‘search_columns’ => ‘user_email’, ‘search’ => ‘*example.com’, ), array( ‘search_columns’ => ‘user_email’, ‘search’ => ‘*abc.com’, ) … Read more

Trim the search result around the search word

I want to trim my search results page down to 20 words before and 20 words after the highlighted search word. I am getting accurate search results and the search word is highlighting. I have tried variations with wp_trim_words(); such as: $trimmed_content = wp_trim_words( $searchresults, 25, NULL ); echo $trimmed_content; but what I so far … Read more

Search by type posts and taxonomy

I want that my search page give results of posts (that i want that show) and taxonomy The code to get just two type of posts: function searchfilter($query) { if ($query->is_search && !is_admin() ) { $query->set(‘post_type’,array(‘lesson’,’series’)); } return $query; } add_filter(‘pre_get_posts’,’searchfilter’); I want it to look for taxonomy too Thanks 1 Answer 1 You can … Read more

Include woocommerce custom field value in front-end search result

currently the search result only showing all the woocommerce default product field (product title, category, tag, .etc). I’ve add a new custom field inside the woocommerce product using this code inside functions.php /** Add Sub-Title option in Woocommerce */ add_action( ‘woocommerce_product_options_general_product_data’, ‘my_custom_field’ ); function my_custom_field() { woocommerce_wp_text_input( array( ‘id’ => ‘_subtitle’, ‘label’ => __( ‘Reference’, … Read more