Category Pages Title

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #8518
    Flukkini
    Participant

    Hello there, is there a way to hide the word “Category” and the “colon” right after it, leaving the category “name” only, on titles of categories pages?
    ex.:
    Not “Category: Travel”
    but “Travel”.

    Thank you.

    #8525
    WP Travel
    Keymaster

    Hello @flukkini,

    To hide the category and display the category title, you have to go through the child theme.

    To know how to activate and create the child theme please follow the link given below:

    http://wptravel.io/how-to-create-a-child-theme/

    After activating the child theme in your child theme functions.php add below given code.

    function wp_travel_child_remove_cat_titles($title) {
    
        if ( is_archive() ) {
    
            $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', 'wp_travel_child_remove_cat_titles' );

    Hope this helps.

    Let us know if you have any confusion regards.

    Thank you.

    Regards!!

    #8531
    Flukkini
    Participant

    thank you.

    #8533
    Support Team
    Keymaster

    Hello @flukkini,

    Glad to help you.

    If you have any issues further then kindly let us know.

    Thank you.

    Regards!!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Travel Log’ is closed to new topics and replies.