Support » Themes and Templates » If has BOTH tags

If has BOTH tags

  • I’m trying something new with my blog to indiciate whether or not a news post has screenshots or video attached. We always add the tag Clips to video posts and Screenshots to screenshot posts, so I’m running this in our code:

    <?php if ( has_tag('Screenshots') ) { ?><img src="http://image1.jpg"> <?php } elseif( has_tag('Clips') ) { ?><img src="http://image2.jpg"> <?php } else { ?> <?php } ?>

    However, some posts have BOTH video and screenshots. Is there any way I’d be able to include something like:

    if ( has_tag('Clips+Screenshots') )

    So that image3 would only show if the post has BOTH tags attached?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘If has BOTH tags’ is closed to new replies.
Skip to toolbar