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
- Search multiple custom fields by using meta_query
- Custom Taxonomy not working with posts_per_page in new WP_query (pagination problem)
- Get value in custom field with taxonomy [closed]
- How to get first post in a category of a custom taxonomy
- Display one post from each term in a custom taxonomy [closed]
- Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request
- Custom metabox for menu administration page?
- Custom Fields and performance
- Search Custom Post Type with all meta attached?
- Is it possible to sort the post based on a custom field?
- On Taxonomy Template page, want to add Post_Type
- The next_posts_link() show me a aditional page in blank
- Help with a query not working with custom taxonomy
- How get custom field from custom taxonomy?
- why do drafts return as part of wp_query?
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- Taxonomy.php issue with search and filters
- Search by type posts and taxonomy
- Storing data into custom taxonomies VS post custom fields (post meta)
- wp_query to find posts by year and month
- How do I use wp_query for WordPress search?
- Including Custom Meta with posts_where query
- Custom fields to taxonomy
- cannot get multiple loops using tax_query
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- How to Filter Posts by Custom Fields?
- wp_query check if integer exists in custom field’s array
- Styling Taxonomy Terms Individually
- How to implement custom search with input fields?
- Display all posts for taxonomy term across multiple custom post types
- search also in taxonomy, tags and custom fields
- Selecting all posts from the children of a particular parent taxonomy
- How can I hide admin columns showing extra custom taxonomy fields?
- Including metaboxes from custom post types in global search — continued
- Extend product search with meta in WooCommerce
- How to create a dependent drop-down and options in dropdown must be manageable from admin panel
- How to separate posts in loop?
- Display value of custom field of custom taxonomy in single post?
- Categorising search results based on Custom Fields
- Custom WP_Query for WordPress Search Results with meta_query
- Multi-select field for Taxonomy can’t save the value
- Custom URLs in Custom Search Results
- Set tax_query conditionally with new WP_Query
- how to store values in database at hierarchical view
- Query custom taxonomy by term id?
- Use an HTML Element To Filter Taxonomies In WP Search
- 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
- saving meta/custom field to tag
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- 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
- Geographic search with taxonomy structure [duplicate]
- Wp_query…a type of term a different div
- 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
- Filter by Custom Taxonomy AND Custom Field
- Can You Build Page Templates Without Extra Files
- search using multiple taxonomies and keyword
- Multiple Drop-Down custom taxonomies search
- Filter with two id of the same value CPT UI(taxanomies)
- Is there a way to nest taxonomies or custom fields deeper than one level below the post type?
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- Create multiple taxonomies with custom fields values on the fly when creating new posts
- Search custom taxonomy via query-string?
- Categories In English version showing not canonical URL, instead shows query search result
- Create new Taxonomy, add extra fields, register terms AND extra fields values?
- Dropdown (with onChange) with custom taxonomies
- ACF – Get unique values of array
- Remove Custom metabox from particular page template is used
- ACF Custom field not showing in Timber Taxonomy page
- Add and Custom category for posts “PAGE”
- how to filter the data’s comparison operators (>= &
- How to filter a taxonomy meta field to the ‘single_term_title’ filter hook
- Include attachments with a custom taxonomy in search
- Run next query based on first query’s term
- Get the original menu item name string instead of the label
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Storing/querying custom date data
- Avoiding stripping of HTML in Custom Taxonomy Meta Field
- add custom fields in custom taxonomy meta box in wordpress-3.5.2
- Custom Taxonomy + JQuery Tabs
- Advanced AND tax_query in sidebar with 2 taxonomies
- Transfer taxonomy to custom field
- How to query posts that are not related to any term of a taxonomy?
- Using wp_query is it possible to orderby taxonomy?
- Custom Fields link to other pages, not search
- Search and filter with custom field in taxonomy
- Custom Taxonomy in custom REST API search