Function: is_tag

is_tag( mixed $tag )

Determines whether the query is for an existing tag archive page.

Shortcut: it

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.

If the $tag parameter is specified, this function will additionally check if the query is for one of the tags specified.

For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.

Parameters

Name Type(s) Default Value Description
$tag mixed ''

Optional. Tag ID, name, slug, or array of Tag IDs, names, and slugs.

Returns

boolean

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.