apply_filters( 'single_term_title', string $term_name )

Filters the custom taxonomy archive page title.


Parameters

$term_name

(string) Term name for archive being displayed.


Top ↑

Source

File: wp-includes/general-template.php

View on Trac



Top ↑

Changelog

Changelog
Version Description
3.1.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 1 content
    Contributed by hasanrang05

    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.