I worked it out myself..
The query I was looking goes like this:
SELECT *
FROM $wpdb->posts, $wpdb->term_relationships, $wpdb->term_taxonomy, $wpdb->terms
WHERE ($wpdb->terms.name LIKE '%$s%'
OR $wpdb->terms.slug LIKE '%$s%'
OR $wpdb->posts.post_content LIKE '%$s%'
OR $wpdb->posts.post_title LIKE '%$s%')
AND $wpdb->posts.ID = $wpdb->term_relationships.object_id
AND $wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id
AND $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id
AND $wpdb->posts.post_status="publish"
AND $wpdb->posts.post_type="products"
ORDER BY $wpdb->posts.post_date DESC
Cheers,
– M
Related Posts:
- Querying Posts by Taxonomy From Alternate Network Site
- WP_Query search posts by custom post type and custom taxonomy
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Querying Term Posts in Loop
- First custom field value (out of several) displayed twice after query
- WP_Query orderby and tax_query
- WP_Query() with custom post type and taxonomy — get all terms?
- Query custom posts from custom taxonomy
- WP_Query for custom taxonomies showing posts from non-specified terms?
- Get posts of an specific term of a custom taxonomy
- Query Pulling the same post twice
- Exclude a category from WP_Query
- $wp_query->queried_object->ID throws warning: Undefined property
- Select All in Parent Category, Group by Child Category?
- get_query_var() not working in pre_get_posts
- query multiple taxonomies
- The Operator “NOT IN” Does Not Work In tax_query
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- How to get the parent’s taxonomy?
- Sort the main query in subcategories/terms?
- Help with hierarchical custom taxonomies and permalinks…almost there
- Custom Taxonomy List links being re-written
- Want to filter only parent post in admin area
- Custom Taxonomy and tax_query Issue?
- Having trouble with custom date field for CPT query (WordPress)
- Custom post query by taxonomy
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Optimised Code for Pulling Taxonomy Posts
- Show Post Count of a Category
- Show Two custom Post type and their posts on category page
- How to filter custom taxonomy categories on archive?
- Use get_post_types to query only custom posts types
- Fetch taxonomies by custom post type id array
- Group custom posts by custom taxonomy names
- How can i skip same post from taxonomy term?
- shortcode to show custom post types by category
- Genesis filterable portfolio isotope [closed]
- convert custom query to wp_query
- Wrong request query on cpt and tax
- Pagination for Custom Taxonomy Page [duplicate]
- Custom loop with multiple taxonomy queries
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Get parse_query filter to return slug instead of id
- Custom taxonomy rewrite give pagination 404
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- creat filter with wp_query
- How to have this permalink structure: post_type/postname/custom_inner_page
- Advanced search form with filters for custom taxonomies
- Why is my WP_Query outputting my entries twice?
- How to display Related Posts based on number of taxonomy terms matched
- Showing specific post in order of array wp_query
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- How to make WP_Query not to show irrelevant posts?
- Variable not working in WP_Query
- WP_query – Filter by tax_query and meta_query using multiple select
- Wp Query with multiple custom tag(taxonomy) by get the terms
- WP_Query parameter conflict
- Can I query posts by taxonomy conditionally based on post type?
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- Query not work for current taxonomy
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- List all Custom Post Type posts excluding certain Taxnomy term
- Custom types, taxonomies and query optimization
- Query Custom Post Type by Taxonomy
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Related “custom post type” using “custom taxonomy”
- WP Query from two Custom Post type fields as statement
- custom post type and a “sticky” position taxonomy
- Display post count for a specific month
- WP_Query to display number of custom post type filtered (order by) taxonomy
- Live search by custom tag
- WP_Query based on ‘s’ and tax_queries
- Custom Taxonomy – fields
- CPT Loop, include taxonomies and disclude others?
- post type => ‘any’ not applied my custom queries
- Ajax load more inside custom post type taxonomy
- WP Query tax_query not returning posts
- Create a custom wp_query from a specific custom post type with specific taxonomy
- The most recent post of custom taxonomy
- Problems with the WP_Query query for a Custom post type
- Display all Custom taxonomy terms and their relevant custom posts
- Query pulling all taxonomies, not one I am specifying
- CPT Efficient way to display posts from different categories with custom query
- Get archive of posts separated by taxonomies and subtaxonomies
- WordPress custom post type
- Post data in separate divs with incrementing class using WP_Query
- Values inside a custom field to determine which category posts to display
- Query child posts on parents single.php?
- WP Query WordPress Post Type with the same Taxonomy name
- How to list groupings and keep pagination
- How to retrieve taxonomy terms of the current custom post?
- Listing all custom post types using a specific term on the said term’s template page, in groups
- How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query
- Filter Custom post type by another Custom post type
- Create a list of months based posts
- display custom post type from register taxonomy
- WP Query Conditionally query meta and taxonomy
- WP Query – Can’t get posts with specific taxonomy