Home Forums Pro Themes Nature Bliss Pro Hide word 'Category' in heading

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #65371
    twistychristie
    Participant

    Hi. I have a nice lists of posts for the Testimonials page, but the heading says Category: Testimonials. How do I remove the word ‘Category’?

    Thank you.

    #65373
    wensolutions
    Keymaster

    Hello @twistychristie,

    If you wish to remove the titles “category:” in the archive, you will need to make customization via a child theme.

    Child Theme Reference: https://codex.wordpress.org/Child_Themes

    You can also automate the process with child theme generator plugin.

    After creating and activating the child theme, paste the following code in your child theme’s functions.php file :

    function nature_bliss_child_remove_archive_titles ($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;
    
    }
    
    add_filter( 'get_the_archive_title', 'nature_bliss_child_remove_archive_titles' );

    This will remove the “Category:” title from the archive listings.

    Hope this Helps,

    Best Regards !!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.