WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] Strict tag filter, possible? (3 posts)

  1. worldismine
    Member
    Posted 1 year ago #

    I created a small external popup with custom menu to search via tags.

    The url looks like this

    Site.com/?category_name=Cool&Tag=tag1,tag2,tag3

    My question is:
    Lets say I have two posts in the same category that share 1 tag, but not others.

    Post one tags:
    Cool, stuff, amazing, five

    Post two tags:
    Cool, sweet, awesome, seven

    Now two post share one tag, but I don't want them to show up in the results unless all other search tags match.

    So since post TWO did not have "sweet, amazing, five" it should not show up when I search for "Cool, stuff, amazing, five"

    I don't know if I am being clear lol I am horrible at trying to explain things.

    I basically want the tags to be very strict. If ALL off my tags that I am searching for do not have a result then I don't want other posts to show up that have one or two other tags.

    I toyed with the options but no clue how to set this up :(

    http://wordpress.org/extend/plugins/relevanssi/

  2. worldismine
    Member
    Posted 1 year ago #

    Kinda like here:
    http://wordpress.org/extend/themes/tag-filter/

    When you pick MATCH ALL OF THE CHECKBOXES it will ONLY show results from the exact tag match.

  3. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    Use the taxonomy query feature of WordPress, and you can define the tags any way you wish.

    Also, in WordPress, listing tags with commas like "a,b,c" means a OR b OR c, but if you list the tags with plus signs ("a+b+c"), it means a AND b AND c, which is what you're after.

    So, just use ?tag=tag1+tag2+tag3.

    This is explained in the WP_Query documentation and Relevanssi supports the WP default implementation.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic