I want to remove it COMPLETELY. Not only the label "Archive: " but EVERYTHING. It should not appear. I've been looking for the solution for hours to no avail.
Please help. Thank you!
I want to remove it COMPLETELY. Not only the label "Archive: " but EVERYTHING. It should not appear. I've been looking for the solution for hours to no avail.
Please help. Thank you!
Share Improve this question asked Nov 12, 2018 at 11:29 Syamsul AlamSyamsul Alam 11 silver badge6 bronze badges 4 |2 Answers
Reset to default 0You can add the following function in the functions.php of your child theme.
add_filter('get_the_archive_title', 'my_get_the_archive_title' );
function my_get_the_archive_title( $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;
}
Basically I'm adding this code in my theme's / child theme's function.php
add_filter('get_the_archive_title', 'my_get_the_archive_title' );
function my_get_the_archive_title( $title ) {
return '';
};
And voilà it's gone, completely, forever!! Just the way I want it!
<title></title>
? – kero Commented Nov 12, 2018 at 11:32<h1>Archive: Bla3</h1>
not removing the title tag, is it possible? – Syamsul Alam Commented Nov 13, 2018 at 3:17