Becky Moore
asked 9 years ago

I have a few category questions.

  1. How can I remove the word "category" from each category page? I’d like for it to just say the name of the category.

  2. How can I get the navigation items to display as their selected colors? For instance, if I make a category yellow, I’d like to be able to hover over the navigation and have it turn yellow. I was able to do this with a previous version of this theme but the code looks very different now.

Thanks!

1 Answers
DominicStaff
answered 9 years ago

Hi,

  1. You can add the following code to the 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;

});
  1. To change background navigation when you hover, you can add the following code to the style.css file:
    .color-green .pagination .page-numbers:hover {
    background-color: #00a53c;
    border-color: #00a53c;
    color: #fff;
    }

Note: You can change the color and class in the above code (eg: .color-yellow/ .color-blue/ .color-)

Hope this helps !

Powered by DW Question & Answer Pro