Hide the Word "Category:" in title on Category Pages

Hi there,

really sorry for again bothering you, I just couldnt’t find a similiar post…

Is there a Custom CSS Code to hide only the Word “Category:” in the title of the actual category page?

I used this code:

body.archive.category h3.archive-title {
display: none;
}

but it hides the total title and I can’t use Page Builder on the Categories-Pages to add a new title without the word “Category:”

My Page is: http://be-the-sparkle.de

Thank you very much in advance!!!

Warmest Regards,

Ann-Kathrin

Hi Ann-Kathrin,

This cannot be achieves with css because archive title function is returning default WordPress function which includes text strings for default archives before in this case name of category, but you can add function over filter like this:

add_filter( 'get_the_archive_title', function ($title) {

    if ( is_category() ) {

            $title = single_cat_title( '', false );
    }

    return $title;
}); 

You have to add that code to functions.php file and if you want permanent change after theme updates then use child theme and add that code from child theme functions.php file.

You can read more about that function on the following link https://developer.wordpress.org/reference/functions/get_the_archive_title/

This will work 100% - see screenshot from my testing installation https://www.screencast.com/t/mMAH6wn5E

Best Regards!

THANK YOU SO MUCH,

worked out Brilliantly!!! I really love this theme and this awesome support :slight_smile:

Warmest Regards,

Ann-Kathrin