admin管理员组文章数量:1024592
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
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
Share Improve this question asked Apr 8, 2019 at 6:11 mirazizmiraziz 11 bronze badge1 Answer
Reset to default 1Since 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;
}
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
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
Share Improve this question asked Apr 8, 2019 at 6:11 mirazizmiraziz 11 bronze badge1 Answer
Reset to default 1Since 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;
}
本文标签: categoriesAdd specific word before the category page title
版权声明:本文标题:categories - Add specific word before the category page title 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745616670a2159332.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论