The problem is that you used OR
, specifically the human verbal colloquial understanding, not the logical definition. What you actually meant was AND
.
Here’s a table demonstrating what happens to A and B for each comparison:
A |
B |
AND |
OR |
XOR |
=== |
---|---|---|---|---|---|
false | false | ❌ | ❌ | ❌ | ✅ |
true | true | ✅ | ✅ | ❌ | ✅ |
false | true | ❌ | ✅ | ✅ | ❌ |
true | false | ❌ | ✅ | ✅ | ❌ |
OR
means if any of the values are true, e.g. if one is false and the other is trueXOR
means if one of the values is true ( but not both at the same time )AND
means if all/both of the values are true, and none are false==
means if both of the values are equivalent e.g.true
and"true"
are equivalent===
/EQUAL
means if both of the values are exactly the same
Related Posts:
- Problem with my loops
- Some doubts about how the main query and the custom query works in this custom theme?
- WP_Query vs get_posts
- Order posts by ID in the given order
- Get the number of posts from the current page results
- WordPress Custom Query to show posts from last x years
- Query Custom Meta Value with Increment
- Group posts by custom field
- How to query ‘posts_per_page’ to display a different blog posts index template?
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- How add a custom posttype name using ACF field to a query post array
- 2 loops on page – one with orderby rand second orderby date
- Query posts by specific word on title
- Five posts from a category in footer
- How to Filter Posts by Custom Fields?
- Multiple loops without repeating content
- WP_Query condition affects posts_per_page count
- Fetch Record based on meta key dates
- Orderby is working with one query but not with other
- Get a list of posts with associated meta_value
- how to make members list directory through wordpress post custom meta key.
- Order by empty custom field
- Some doubts about how the main query and the custom query works in this custom theme?
- Query all posts if multiple meta key don’t exist
- How do I rewrite this loop as a new WP_Query style-loop?
- Include current post into loop
- How to provide meta_key array to wp_query?
- Order post type by sum of two custom fields
- get_posts output always same post
- How to create custom query by keyword in post title?
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Get posts that do not have the same tags as current
- Should I reset $wp_query?
- WP ForLoop to compare meta information of posts to determine what post to display
- Posts query according to meta box date
- Query only displays one page_id
- 2 queries with counters
- Paginate pages with dynamic query
- Performance concerns: index.php vs taxonomy-$taxonomy.php
- Determine if ID is page or post and query the ID
- Custom template for password protected page
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- How do i create a custom post query when the meta value is an array?
- display ACF repater field in archive page
- Duplice post with standard WP loop – fixed by using query_posts() instead
- How do I stop the same post showing multiple times in a archive?
- Custom query for custom post type not getting correct post ID
- WordPress For Loop Prints Unwanted Extra Paragraph Element
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- Custom WP_query and integrating into theme file
- query_posts() doesn’t seem to be called in my page
- Some doubts about how the main query and the custom query works in this custom theme?
- Ordering Posts by parent category, name ascending
- WP_Query a custom field value bringing back 0 results
- Custom search (wp query by custom fields)
- Loop through multiple custom fields with increasing number
- How do I display posts with specific value in a custom field into my loop?
- query_posts with sorting on a custom datestamp
- query post based on comparison
- Converting an existing query_posts to WP_Query
- Multiple loop for “featured” items returns wrong posts
- Show number of posts AND number on current page (cannot make it work)
- Multiple WP_Query loops with Pagination
- Too slow when using both ‘tax_query’ and ‘meta_query’ both in WP_Query
- Order posts by custom field and if custom field is empty return remaining posts
- Add inline HTML to posts published within last 24hrs
- How do you query wordpress posts using a math formula between multiple meta field values?
- Ordering Posts Type A by Custom Fields of related Post Type B
- Custom category search box for WordPress
- Refine search results using WP_Query
- How to pass many ids in post__in?
- How to show subcategories using loop?
- Sub-loop / nested loops Best Practices
- Query with a meta value inside a given range
- How do I run through a WordPress loop called from a filter function?
- How do I get the title of a category in a custom loop?
- Blog post per page setting conflicting with custom WP_Query?
- How to list custom fields as headers and list all pages sharing that custom field under it?
- Check if loop has any categories?
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Get all fields inlcuding “ACF” (Advanced Custom Fields) columns in wp_query
- Assign custom parameter to each post in query
- How to get posts published on the latest date?
- posts archive page – closing WP_Query loop correctly [closed]
- AJAX Breaking Offset Argument In WP Query
- Continue or break the while loop
- Excluding posts with certain value of meta_key keeping posts without that meta_key
- Function using get_posts() with tax_query not working when called from functions.php
- Why doesn’t my WP Meta Query return any results?
- How to make the ‘request’ filter work?
- how to get custom attachment url?
- ACF Post Object meta-query by title not ID
- WP_Query & Duplicate entries
- From admin edit user page query either the user_nicename or username field value of the user profile being edited or viewed
- Fetching $_POST from Page Template into functions.php
- Carousel Loop only duplicating
- Taxonomy related query not working
- How to show featured post first, then separate loop for other posts
- Query All Posts: Either Display Most Recent or One with Particular ACF Value Chosen