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 {$wpdb->posts}.ID = tr.object_id INNER JOIN {$wpdb->term_taxonomy} tt ON tt.term_taxonomy_id=tr.term_taxonomy_id INNER JOIN {$wpdb->terms} t ON t.term_id = tt.term_id";
$join .= "LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id)";
return $join;
}
Related Posts:
- Search Tool only refreshes Page without showing results
- Removing “s” from search with custom parameters
- Taxonomy or Custom Field
- Advanced WordPress search form based on custom taxonomy and custom meta value
- Using wp_query is it possible to orderby taxonomy?
- Advanced search form with filters for custom taxonomies and custom fields
- “tax_query” parameter not working with WP_Query
- How do I exclude a custom taxonomy from the post loop
- Is ACF being a honey trap? [closed]
- Add custom taxonomy fields when creating a new taxonomy
- Using pre_get_posts to rewrite search query to display posts from multiple taxonomies
- Custom Taxonomy and Tax_Query
- Exclude Specific Term from Search
- WordPress database error: [Not unique table/alias: ‘wp_postmeta’]
- Using WordPress to make a “Product Search” type navigation drilldown
- How to create a dependent drop-down and options in dropdown must be manageable from admin panel
- How to separate posts in loop?
- Custom Taxonomy Not Working When added to WordPress Search
- First custom field value (out of several) displayed twice after query
- WordPress thinks my custom taxonomy pages are search pages #seo
- Display value of custom field of custom taxonomy in single post?
- Categorising search results based on Custom Fields
- Hiding taxonomies with no children WP_Query & tax_query
- Can I use OR relation for one item when calling tax_query from WP_Query and use AND for the rest?
- How to fetch the data from Advanced Custom post when we search specific keyword or field name related to the post?
- Custom WP_Query for WordPress Search Results with meta_query
- How do I display a custom field from a custom taxonomy in single.php?
- Advanced search form with filters for custom taxonomies
- Multi-select field for Taxonomy can’t save the value
- Passing form inputs into multi-taxonomy query
- Custom URLs in Custom Search Results
- Set tax_query conditionally with new WP_Query
- querying posts by custom taxonomy terms right from a querystring based URL
- Search Query for Multiple Terms In Same Taxonomy
- WordPress implode & wp_insert_post question
- Search posts missing a particular custom field
- how to store values in database at hierarchical view
- Query custom taxonomy by term id?
- Best structure for entering recipes in a WordPress theme?
- Use an HTML Element To Filter Taxonomies In WP Search
- WP REST API – get custom taxonomies based on terms & filter
- When filtering query on custom taxonomy; main menu dissapears
- Exclude taxonomy term from all loops, but having it on widget
- Why can’t I use an array of term slugs in WP_Query?
- wp_query not resetting, last post hanging
- Using WP_Query and Query_post for the loop?
- Copy/clone/associate Custom field to Custom Taxonomy
- Problem with wordpress pagination
- How to do a particular wp_query taxonomy search
- saving meta/custom field to tag
- how to get this tax_query working?
- Custom Taxonomy Search result page
- Why isn’t the ‘no results’ being shown when a query returns no results?
- How to support fifteen thousand terms in WordPress?
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Different Taxonomy Values for Each Post
- Clean Custom URL for Serach + Custom Taxonomy
- Advanced search redirecting to another page then filter further
- Filter through custom taxonomy with an array of taxonomy IDs
- What’s the best way to add taxonomy’s image in 2017?
- Search only custom taxonomies
- Loop through custom taxanomy in post and display custom fields from posts
- How to restrict search on a certain page to only return results against custom taxonomies?
- WordPress autocomplete search with taxonomies
- Geographic search with taxonomy structure [duplicate]
- Wp_query…a type of term a different div
- check if a taxnomy queried in $wp_query?
- Taxonomy.php how to show post only in current taxonomy with wp_query?
- Why can’t I access Custom Taxonomy metadata?
- WP_Query tax_query – Show results if child has parent X
- Query custom taxonomy for category including children
- SQL / wp_update_post: change post custom field to CPT post taxonomy
- Proper way to create taxonomy queries
- how to use tax_query to apply both terms or one if one is empty
- Get current page term title to use in WP_Query
- passing moree than one value of slugs in taxonomy using variable
- Filter by Custom Taxonomy AND Custom Field
- Can You Build Page Templates Without Extra Files
- search using multiple taxonomies and keyword
- Extra Meta Data for WordPress Multisite Taxonomy
- Multiple Drop-Down custom taxonomies search
- Filter with two id of the same value CPT UI(taxanomies)
- Amend taxonomy to search in wordpress admin
- Include get_term_link inside search
- Is there a way to nest taxonomies or custom fields deeper than one level below the post type?
- Product custom taxonomy is not found when space in name
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- How to use custom slug and custom templates for custom taxonomy?
- Create multiple taxonomies with custom fields values on the fly when creating new posts
- display ACF repater field in archive page
- Rewrite Search URL Permalink For CPT Custom Taxonomies
- Search custom taxonomy via query-string?
- Custom field with terms from another taxonomy programmatically
- Convert post meta to custom taxonomy?
- Categories In English version showing not canonical URL, instead shows query search result
- How to exclude woocommerece product category in search results?
- Count tags for current post and save into custom meta field (and update it on post edit)
- Create new Taxonomy, add extra fields, register terms AND extra fields values?
- Live search by custom tag
- Dropdown (with onChange) with custom taxonomies