Forums › Forums › Search & Filter Pro › Displaying posts that have two tags (XX and XX relationship)
Tagged: tags
- This topic has 5 replies, 2 voices, and was last updated 4 years, 11 months ago by Trevor.
-
Anonymous(Private) December 20, 2019 at 2:33 pm #229586
I might be completely overlooking something, but I can’t seem to figure out how to display posts that have two (or more) defined tags.
Profile 1: tag1
Profile 2: tag2
Profile 3: tag1 & tag2I want to show only results like Profile 3, is there a way to do this while using shortcodes?
Trevor(Private) December 20, 2019 at 4:12 pm #229593What you want to do is add a query condition so that only posts with both tags are returned? I think you may need to use this filter:
https://searchandfilter.com/documentation/action-filter-reference/#edit-query-arguments
Anonymous(Private) December 20, 2019 at 4:26 pm #229599Regarding the suggestion, unfortunately this doesn’t tell me much. Coding isn’t my strong suit, so I’m not too sure how to adapt & implement this to my situation.
I make a search form which displays results with Tag1, then adapt this code so that it checkes the results for tag2, and if they have tag2 it gets displayed?
Trevor(Private) December 20, 2019 at 5:22 pm #229601It would require coding. The code i much the same as normal wp_query code, but I have no snippets to share with you.
Are they standard ‘tags’ from WordPress, or a custom taxonomy, and are you searching normal WordPress ‘Posts’ or a Custom Post Type?
I can probably find a snippet on the Stack Exchange (WordPress) site.
-
AuthorPosts