Home Forums Pro Themes Tourable Pro Remove the word Category from Category: Category Title on archive pages

This topic contains 1 reply, has 2 voices, and was last updated by  wensolutions 1 week, 5 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #105542

    Hassan Christopher
    Participant

    Hello, I would like to change or remove “Category:” here to just be the Category Title. Alternatively, it would be ok to have it reflect the custom category base updated via permalink structures. In this case it would be the word “Show”. Please advise at your earliest convenience. Thanks!

    #105683

    wensolutions
    Keymaster

    Hello @hchtis,

    Thank you for using the theme.

    To remove the category you need to go through the child theme.

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

    function tourable_pro_child_custom_cat_title_removal ($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>' ;
    
            } elseif ( is_archive() ) {
    
            	$title = preg_replace('/^\w+: /', '', $title);
    
            }
    
        return $title;
    
    }
    
    add_filter( 'get_the_archive_title', 'tourable_pro_child_custom_cat_title_removal);

    Hope this helps.

    Thank you

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.