N
N
Nostromo2018-02-09 18:16:46
css
Nostromo, 2018-02-09 18:16:46

How to hide the word "Category:" in Wordpress?

Good afternoon !
Tell me how to hide the word "Category:" in Wordpress, so that each time you update it, you don’t have to correct the code?
Thank you for your attention.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael Saparov, 2018-02-10
@MichaelSaparov

Apply the hook to get_the_archive_title()
<?php single_cat_title('You are viewing: '); ?>. - in this case, this text will be displayed
There are a lot of solutions on the net, here on several sites:
//Remove the word heading
add_filter( 'get_the_archive_title', 'artabr_remove_name_cat' );
function artabr_remove_name_cat( $title ){
if ( is_category() ) {
$title = single_cat_title( '', false );
} elseif ( is_tag() ) {
$title = single_tag_title( '', false );
}
return $title;
}
Add to the end of the theme's functions.php.
Tags and categories will also be removed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question