As with most questions involving OR
clauses, the answer is the same: use a custom query or alter WP_Query
using the 'posts_clauses'
filter.
Related Posts:
- When should you use WP_Query vs query_posts() vs get_posts()?
- WP_Query vs get_posts
- Ordering Posts by parent category, name ascending
- When should you use WP_Query vs query_posts() vs get_posts()?
- When to use WP_query(), query_posts() and pre_get_posts
- Wp get all the sub pages of the parent using wp query
- How to query for most viewed posts and show top 5
- Query Custom Meta Value with Increment
- Perform query with meta_value date
- WP_Query ordered by custom field that is a date string?
- Meta Query with date and time on the same Day before given time
- Can not switch the queried post in pre_get_posts hook
- How to find out what “Blog pages show at most” is set to [duplicate]
- WP_query category__in not working, only pulls from first category
- Pass the same object to multiple widgets in a template with one query
- Retrieve or Query Pages by ID
- How do you query wordpress posts using a math formula between multiple meta field values?
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- Page navigation doesn’t show when query category
- How do you Query posts with nothing in common?
- Creating a custom search for a specific post type
- How to query a custom post type with a taxonomy filter but display post type archive page?
- Change query_posts to WP_Query in page but does not work
- Custom Query num_rows returns wrong amount
- add active class based on permalink and url
- Weird orderby => post__in issue
- Slow page loads due to WordPress Core Query
- Query Page Content From Theme Options?
- Check return value of get_posts
- Reset WordPress Post Query to default
- How can I override one post and make it display content for another post?
- Include current post into loop
- Get all posts which was posted on X Days WordPress
- Filter post query to only show direct children of category
- get_posts output always same post
- Use WP_Query or query_posts() or get_posts() for optimizing a site?
- complex get_posts() query to select child pages
- Should I reset $wp_query?
- How to give classname to post if post has no content?
- Posts query according to meta box date
- Why doesn’t my WP Meta Query return any results?
- How to query for a page, get data, then query for child pages of that page
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- Prioritising and Ordering Posts By Category Name Using A Custom Loop
- Filter products on category AND tag
- Facing problem with tax_query results
- pre_user_query vs pre_get_posts
- Get posts that match defined arrays of tags
- How to get meta key list efficiently?
- I need query_posts() to order results first by a meta value and then by post ID
- How to show post title in content editor in backend?
- My entry results are not consistently alphabetized
- Merge two queries and remove duplicate
- Optimising specific Query with ACF meta objects
- How to organize a WP_Query’s list of posts by category and display category title?
- Retrieve posts in custom post type and specific taxonomies
- How to query post ids liked by the Author
- WordPress Query showing multiple titles
- Query Posts by date range with fixed beginning and end
- custom query to get posts
- A Depth Like Parameter For “get_posts”
- Using OR conditions in meta_query for query_posts argument
- Sanitation needed for WP_Query or get_posts calls?
- What is the most efficient way of querying posts based on visits and date for current day?
- Get posts by menu ID
- Is it better practice to use query_posts, WP_Query, or get_posts to create various custom loops within a Page?
- What should I use, get_posts or wp_query for less CPU load?
- How add a custom posttype name using ACF field to a query post array
- Get image of latest post from taxonomies/categories
- How To Get Some Data From WordPress Database Using WordPress $wpdb Query?
- 2 loops on page – one with orderby rand second orderby date
- Undefined WP_Query::has_posts()?
- Create ONE callback for all page templates, post filter queries + paginated pages, triggering pagination via AJAX
- get_posts – get all posts by array of author
- How to access a query twice in different template files?
- How to display multiple custom fields with the same meta_key in an ascending order?
- No results found from a $wpdb->get_results() query when trying to join more than one meta key query
- WP_Query post_parent parameter always returns children of current page
- How to exclude post formats from wordpress recent posts in a tabs widget [closed]
- How to increase load time of an archive/search page (WP_Query)
- Yoast primary category query modification
- Get next/prev image/attachment in time with date query
- Function using get_posts() with tax_query not working when called from functions.php
- Include one page/post into query which is already returning posts
- Search for pages with permalink
- Optimising WP_Query with ACF Fields
- Doing $wpdb->get_results returns NULL, doing the same query in my DB returns correct value
- query_posts() doesn’t seem to be called in my page
- Fetching $_POST from Page Template into functions.php
- Query posts in current category but not attachment format
- wp_query – Modify $query to include duplicate content
- How to get several fields from wp_query?
- Pagination not working with WP_Query (creates links but no page)
- query_posts with sorting on a custom datestamp
- Why WP_Query in functions.php is not working when get_posts works?
- Query custom post type by date field only working when two posts match the query
- query by meta value then date and not empty meta value
- Query specific number of posts for each post type in specific order
- WordPress extremely slow when using get_posts with multiple meta_query relations
- Search results stuck on page 1