the_tags

Retrieve the tags for a post.

Description

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

Parameters (3)

0. $before — Optional. (constant) => null
Before list.
1. $sep — Optional. (string) => ', '
Separate items using this.
2. $after — Optional. (string) => ''
After list.

Usage

  1. if ( !function_exists( 'the_tags' ) ) { 
  2. require_once ABSPATH . WPINC . '/category-template.php'; 
  3.  
  4. // Optional. Before list. 
  5. $before = null; 
  6.  
  7. // Optional. Separate items using this. 
  8. $sep = ', '; 
  9.  
  10. // Optional. After list. 
  11. $after = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = the_tags($before, $sep, $after); 
  15.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/category-template.php  
  1. function the_tags( $before = null, $sep = ', ', $after = '' ) { 
  2. if ( null === $before ) 
  3. $before = __('Tags: '); 
  4.  
  5. $the_tags = get_the_tag_list( $before, $sep, $after ); 
  6.  
  7. if ( ! is_wp_error( $the_tags ) ) { 
  8. echo $the_tags;