SEO Question Answer

How to remove "Category:", "Tag:", "Author:" from the_archive_title

0 votes
I do want to show "Category:", "Tag:", "Author:" in my archive page, how to remove please help
asked Nov 27, 2016 in Wordpress by Mukesh Sharma

1 Answer

0 votes
Best answer
Add this block of code to your functions.php file.

add_filter( 'get_the_archive_title', function ($title) {
    if ( is_category() ) {
            $title = single_cat_title( '', false );
        } elseif ( is_tag() ) {
            $title = single_tag_title( '', false );
        } elseif ( is_author() ) {
            $title = '<span class="vcard">' . get_the_author() . '</span>' ;
        }
    return $title;
});
answered Nov 27, 2016 by suresh (480 points)
Welcome to Digital Marketing Q&A, where you can ask questions and receive answers from other members of the community.
5 questions
2 answers
0 comments
1 user