Does WordPress support AND tagging instead of OR? (3 posts)

  1. wp_ntnguy
    Posted 3 years ago #

    Based on this example here from the Codex http://codex.wordpress.org/Function_Reference/is_tag:

    is_tag( 'mild' );
    // When the archive page for tag with the slug of 'mild' is being displayed.
    is_tag( array( 'sharp', 'mild', 'extreme' ) );
    // Returns true when the tag archive being displayed has a slug of either "sharp", "mild", or "extreme".

    Does anyone know how to modify the function of WordPress so that it will return true when the tag archive being displayed has the slugs "sharp" and "mild" and "extreme" ?? I need all three slugs to return a true. If there are either of the two slugs, or if there is only one of the slugs, then it returns false.

    Is this even possible to do with WordPress?

  2. Mattthew
    Posted 3 years ago #

    I would like to know this as well, if I figure it out I will post it. I am after a conditional statement similar to this issue, when I search with ?tag=one+two I want to show something based on either of those, but it only works when it's the first one used. So is_tag('one') works but is_tag('two') is false unless I re-order them.

  3. Mattthew
    Posted 3 years ago #

    Problem is that when you is_tag it only uses the first one. Mine is the same issue, though you want them all (which is easy if it looks at more than the first one) I just want to show something when any of them are a certain tag. I could do it in php, but seems like wordpress is bound to have a way!

Topic Closed

This topic has been closed to new replies.

About this Topic