0

in my site category page (archive page), the page title in browser is like this:

My site | Site Description | Category title

How i can add specific word befor all of category title. like:

My site | Site Description | My word Category title

1 Answer 1

1

Since WP 4.4 you can change document title using document_title_parts filter hook, in earlier versions it will be wp_title_parts (since v4.0) or wp_title filter.

add_filter( 'document_title_parts', 'se333744_site_title' );
function se333744_site_title( $title )
{
    if ( isset($title['title']) && strlen($title['title']) && !is_front_page() && is_archive() )
        $title['title'] = ' {some prefix} ' . $title['title'];
    return $title;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.