Sort by postmeta on when searching
Problem was that I had a plugin installed that deals with the searches, it’s called Better Search. function query_1($query){ $query .= “,wp_postmeta.meta_value as total_saless “; return $query; } add_filter( ‘bsearch_posts_match_field’, ‘query_1′ ); function query_2($query){ $query .= “AND wp_postmeta.meta_key=’total_sales’ “; return $query; } add_filter( ‘bsearch_posts_where’, ‘query_2’ ); function query_3($query){ $query = ” CAST(total_saless AS INTEGER) > … Read more