how to search in custom fields & custom taxonomy for custom search

Managed to figure it out by adapting that code from the link i posted: function atom_search_where($where){ global $wpdb; if($_SESSION[‘js’] != ”) $where .= “OR (t.name LIKE ‘%”.trim($_SESSION[‘js’]).”%’ AND {$wpdb- >posts}.post_status=”publish”)”; $where .= “OR ($wpdb->postmeta.meta_key = ‘_job_ref’ AND $wpdb->postmeta.meta_value=””.$_SESSION[“js’].”‘)”; return $where; } function atom_search_join($join){ global $wpdb; if($_SESSION[‘js’] != ”) $join .= “LEFT JOIN {$wpdb->term_relationships} tr ON … Read more

Autoremove empty custom fields

I believe this was my solution to a previous question you had. I mentioned in that answer that the code didn’t deal with the eventuality of a key with multiple values and only some of which are empty. The reason why is how WordPress treats delete_post_meta… When using delete_post_meta, the first two arguments specify the … Read more

Can ordering post list by meta_value cause performance issue?

meta_query & tax_query behavior When you’re defining a meta/tax_query and make use of the new array style argument list for multiple sets of term or custom field keys, then your query might look close to the following array( ‘tax_query’ => array( ‘relation’ => ‘OR’, array(‘taxonomy’ => ‘tax1’, ‘field’ => ‘slug’, ‘terms’ => ‘term1’), array(‘taxonomy’ => … Read more