apply_filters( ‘single_term_title’, string $term_name )

Filters the custom taxonomy archive page title.

Parameters

$term_namestring
Term name for archive being displayed.

Source

$term_name = apply_filters( 'single_term_title', $term->name );

Changelog

VersionDescription
3.1.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    Return with custom prefix text:

    add_action('single_term_title', 'single_term_title_28072021');
    
    function single_term_title_28072021($term_name){
    
        $queried_object = get_queried_object();
        $taxonomy = isset($queried_object->taxonomy) ? $queried_object->taxonomy : '';
    
    
        return sprintf(__('Product Category: %s','textdomain'), $term_name);
    
    }

    Return with taxonomy prefix text:

    add_action('single_term_title', 'single_term_title_29072021');
    
    function single_term_title_29072021($term_name){
    
        $queried_object = get_queried_object();
        $taxonomy = isset($queried_object->taxonomy) ? $queried_object->taxonomy : '';
    
    
        return sprintf(__('%s: %s','textdomain'), $taxonomy, $term_name);
    
    }

You must log in before being able to contribute a note or feedback.