Okay
  Public Ticket #1311630
How to remove "CATEGORY:" from archive pages?
Closed

Comments

  •  1
    leadingdesigns started the conversation

    Hi there, 

    Just a quick one - I'm looking to remove the word "CATEGORY:" from the category archive pages. So viewing a category called Business for example, the user would just see "Business" rather than "CATEGORY: Business"

    Any help would be much appreciated! 

  •  56
    Cuong replied

    Hi,

    Let append this snippet to the bottom of radians/functions.php file

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

    I get this code snippet from this question and the solution is perfect.

    Hope this helps,

    Cuong Tran

    Wordpress lover. My Profile

  •  1
    leadingdesigns replied

    Hi Cuong - this worked great, many many thanks indeed!

  •  56
    Cuong replied

    No problem, James.

    Wordpress lover. My Profile