How to craft a query properly to only show posts with an AND relationship
-
Hi, Bill. I’ve dug through your website and this forum, but I’m still beyond puzzled why the query structure I’m trying to do won’t work.
I want to display posts that are within the categories of florida-trail and northwest-florida (the posts must be tagged with both categories) and only show the posts from that list that have a tag of favorites.
I’ve tried this:
[display-posts category=”northwest-florida,florida-trail” tag=”favorites” posts_per_page=”-1″ order=”ASC” orderby=”title” image_size=”featured-page” include_excerpt=”true”]Which brings up all posts in the category of northwest-florida with a tag of favorites, but does not restrict the posts only to those in both the florida-trail category AND the northwest-florida category
And this:
[display-posts post_type=”post” taxonomy=”category” tax_term=”florida-trail,northwest-florida” taxonomy_2=”tag” tax_2_term=”favorites”]Which shows no posts at all
There must be a simple solution but I’ve been going crazy digging around your documentation trying to figure it out, and no luck.
Many thanks.
- The topic ‘How to craft a query properly to only show posts with an AND relationship’ is closed to new replies.