Function Reference/has tag
(Add your language)
Check if the current post has any of the given tags. The given tags are checked against the post's tags' term_ids, names and slugs. Tags given as integers will only be checked against the post's tags' term_ids.
If no tags are given, determines if post has any tags.
<?php has_tag( $tag, $post ); ?>
- (mixed) (optional) The tag name, term_id or slug. Also accepts an array of tag names, term ids and slugs
- Default: None
- (object) (optional) Post to check instead of the current post.
- Default: Current post
- True if the current post has any of the given tags (or any tag, if no tag specified), false otherwise.
has_tag() is located in