Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
// удаляем "Рубрика: ", "Метка: " и т.д. из заголовка архива
add_filter( 'get_the_archive_title', function( $title ){
return preg_replace('~^[^:]+: ~', '', $title );
});
here is another option for a change, but the first one and I like it more
function x_theme__remove_name_cat( $title ){
if ( is_category() ) {
$title = single_cat_title( '', false );
} elseif ( is_tag() ) {
$title = single_tag_title( '', false );
}
return $title;
}
add_filter( 'get_the_archive_title', 'x_theme__remove_name_cat' );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question