W3cubDocs

/WordPress

the_tags( string $before = null, string $sep = ', ', string $after = '' )

Displays the tags for a post.

Parameters

$before

(string) (Optional) String to use before the tags. Defaults to 'Tags:'.

Default value: null

$sep

(string) (Optional) String to use between the tags.

Default value: ', '

$after

(string) (Optional) String to use after the tags.

Default value: ''

Source

File: wp-includes/category-template.php

function the_tags( $before = null, $sep = ', ', $after = '' ) {
	if ( null === $before ) {
		$before = __( 'Tags: ' );
	}

	$the_tags = get_the_tag_list( $before, $sep, $after );

	if ( ! is_wp_error( $the_tags ) ) {
		echo $the_tags;
	}
}

Changelog

Version Description
2.3.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/the_tags