Your SQL dump proved to be informative.. Either 1=2 or 1=0 in a SQL statement means something you passed your WP_Query
was invalid.
It appears that in your tax_query
you specified 'field'=>'term_id'
, which isn’t a valid option – it should be just 'field'=>'id'
.
Related Posts:
- Change searched term
- How to reset usual $query on search page to push custom $wpdb query there?
- what are the numbers between curly brackets in search query
- Search custom post type by meta data
- Custom query filter not working on woocommerce category page
- Search Terms – Querying on either description__like OR name__like in the same Term Query?
- $query->query_var[‘post_type’] not set for pages
- Filter query posts by the count of metas for a meta key
- search through post-type attachments titles
- How to set back query var author_name after unset it?
- pre_get_posts : ‘post__not_in’ doesn’t work with global variable
- Search query -> Show all pages except certain template
- Temporarily storing main search result
- Replace/Mute/Stop Search Query
- Query based on title, with ‘compare’ => ‘IN’
- is_search called incorreclty
- Attempt to improve WP search, can someone check my SQL query?
- Searching With Apostrophe
- How to change the amount of posts previewed on a page?
- Ideas how to search & replace post_content when string contains a newline?
- How to insert Collate into WordPress search query?
- Slow Search Queries – How to exclude pages, media, excerpt, authors, private posts?
- How to interfere to default search to make it search in custom fields?
- How to manage a particular “order by” for get_search_query()?
- Merge CPT Taxonomy and Post Taxonomy in $query->set
- WordPress search in modified post title
- Filter orders by modify date
- How to add url parameter to every search query in SearchWp?
- Add rewrite rule for archive search
- custom sorting media with multiple filters – error: not unique table/alias: wp_postmeta
- Restrict WordPress search to a single ACF field
- Modify behaviour of “s” parameter in wp_query
- Sort by postmeta on when searching
- Pagination adds search query (again)
- Speed up search query that searches in post meta?
- New custom post type entries are not sorted correctly in admin using pre_get_posts
- How to make MySQL search queries with quotes
- Limiting a filtered query
- $query->set( ‘post_type’, ‘post’ ); not working
- Why the pre_get_posts hook can cause apache stopped working?
- search.php is not generating the right results
- excludeCat function reverses order of blog posts
- Set posts per page for parent category and it’s all children
- Filter multiple different main queries on custom pages
- How to display search query as formatted text?
- Modify a query using both a text field and a true/false AFC field
- Admin Post List table Query filtering “WHERE” for custom post type
- Search query alteration not working for meta values
- pre get posts not working with Tribe Events
- Can I filter existing search query using pre_get_posts for post_mime_type?
- is_search called incorrectly
- How to allow searching a custom meta key in admin list table?
- How to display SQL query that ran in query?
- How can I create a meta_query with an array as meta_field?
- Query multiple meta key values?
- How to Optimize WP site for millions of posts
- How to get comments by post ID?
- Differences between wpdb->get_results() and wpdb->query()
- Is there a way of increasing the speed of this query?
- Using pre_get_posts to rewrite search query to display posts from multiple taxonomies
- Get all image from single page using this query
- How can I query all users who registered today?
- Get Terms by IDs with IDs order
- Custom search filter causes menu and query_posts problems
- Reversing the order of posts AFTER the query is performed
- simple sql query on wp_postmeta very slow
- Using WordPress public query variables
- How to Use Wildcards in $wpdb Queries Using $wpdb->get_results & $wpdb->prepare?
- When/why does ‘$query->get( ‘tax_query’ );’ return empty?
- is_category() in pre_get_posts strange error
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- How to get link and title of next and previous post on single page
- Create pagination and order according to alphabet
- wpdb get posts by taxonomy SQL
- How to uniquely identify queries?
- How to List Events by Year and Month Using Advanced Custom Fields?
- Is there any difference between hooks posts_where with posts_join and posts_search performance wise?
- Order Search Results Page by meta_value If no Value Return Remaining Results
- wordpress query – orderby child post date
- How do I search events between two set dates inside WP?
- How many WordPress SQL Queries per page?
- Filter the query ONLY for the search results page
- pre_get_posts with get_posts
- How to display Section for certain time
- Add multiple value to a query variable in WordPress
- Add Custom Post Type to Current Query
- Custom query_var causes displaying posts archive on front page
- Slow wp_enqueue_media()
- Search ONLY by meta key / meta values
- Multipart/formatted MySQL query problem
- What is the most efficient way of implementing a favorite post system?
- How do I create a meta box for dates?
- Remove [gallery] shortcode altogether
- Search and replace text across all posts
- Compare two numeric custom fields
- wp_dropdown_categories with multiple select
- Advanced Custom Fields – Query Efficiency
- Why does get_the_time(‘F j’) return November 30 for all posts?
- Query by one meta_key and sort by another (possibly NULL value)
- How to tune search argument in WP_Query to show only exactly the same results?