• Resolved mumlifemadesimple

    (@mumlifemadesimple)


    Hi there

    I have used categories to create category pages in my menu. I want to remove the category title from these pages please. I’m looking for CSS if possible that I can simple put in the Custom CSS field as I’m not good at modifying theme files and I’m not using a child theme.

    Any assistance would be great!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @mumlifemadesimple

    Please keep this code in functions.php,hope it works

    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;

    });

    Theme Author WP Puzzle

    (@wppuzzle)

    @mumlifemadesimple, you can use this CSS, but it is only hide title, not remove from html code.

    For categories only:

    body.category .inform h1 {
        display: none;
    }
    

    For all archives:

    body.archive .inform h1 {
        display: none;
    }
    
    • This reply was modified 7 years, 9 months ago by WP Puzzle.
    • This reply was modified 7 years, 9 months ago by WP Puzzle.
    Thread Starter mumlifemadesimple

    (@mumlifemadesimple)

    Thank you both for replying! The CSS worked! Much appreciated ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove Category Title on Category Pages’ is closed to new replies.