the_archive_title

Display the archive title based on the queried object.

Description

the_archive_title( (string) $before = '', (string) $after = '' ); 

Parameters (2)

0. $before — Optional. (string) => ''
Content to prepend to the title. Default empty.
1. $after — Optional. (string) => ''
Content to append to the title. Default empty.

Usage

  1. if ( !function_exists( 'the_archive_title' ) ) { 
  2. require_once ABSPATH . WPINC . '/general-template.php'; 
  3.  
  4. // Optional. Content to prepend to the title. Default empty. 
  5. $before = ''; 
  6.  
  7. // Optional. Content to append to the title. Default empty. 
  8. $after = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = the_archive_title($before, $after); 
  12.  

Defined (1)

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

/wp-includes/general-template.php  
  1. function the_archive_title( $before = '', $after = '' ) { 
  2. $title = get_the_archive_title(); 
  3.  
  4. if ( ! empty( $title ) ) { 
  5. echo $before . $title . $after;