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)
- How to query post ids liked by the Author
- wp_query pagination links producing 404
- loop through custom post types with meta data
- WordPress Query showing multiple titles
- Query Posts by date range with fixed beginning and end
- custom query to get posts
- get contents and permalink from a specified page
- Display First posts without the default featured image
- Pull Instagram images into an existing loop?
- Loop being strainge
- Using Query In Post Type Archives
- Display posts where date field matches current month?
- $query conflicting with other queries in the same page
- How ‘secure’ are loops?
- Pagination in custom query not working [duplicate]
- Filtering posts by WORD in custom field
- Having trouble using this post category query on multiple pages?
- Query Posts to fetch Posts with Unique Tag
- Help in query for list links
- Multiple loops on index page with sticky post and pagination
- Exclude categories and subcategories in QueryLoop
- Pagination problem with multiple loops on the same page
- Display agents (custom post type) alphabetically, except one who always shows last
- Problem with WP_Query sort
- Display all custom meta field values from the database using ACF Repeater
- query_posts problem – need help
- WordPress Post Looping? [duplicate]
- How to do a loop inside a loop?
- Carousel Loop only duplicating
- Remove 5 latest posts from the loop
- Exclude post formats in custom loop
- Taxonomy related query not working
- How do I correctly query posts from a post ID?
- Pagination in category.php not functioning
- Get author meta data with no published posts in author.php?
- Query for page content, and query for posts on the same page?
- Can’t seem to get an else statement correct? [closed]