Support Forums

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Displaying posts that have two tags (XX and XX relationship)

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Yoran Heij
    #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 & tag2

    I want to show only results like Profile 3, is there a way to do this while using shortcodes?

    Trevor Moderator
    #229591
    This reply has been marked as private.
    Trevor Moderator
    #229593

    What 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

    Yoran Heij
    #229597
    This reply has been marked as private.
    Yoran Heij
    #229599

    Regarding 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 Moderator
    #229601

    It 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.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.