1

I am using theme Twenty Sixteen. I created a menu using categories, and when I click on one and end up on a category page that has a "Category : ..." title. I would like to remove that title so that only posts are displayed.
I found this similar post : Remove "Category Archives: title" at the top of a category page
However, the theme files are not the same and I can't find a "category.php" file. Does anyone know where to find the line responsible for displaying that category title ?
I would greatly appreciate your help, thank you :)

1

That title is coming from archive.php file of TwentySixteen theme.

You can find a <header> code section in that file.

What you can do, simply copy the archive.php file as category.php and then remove the following code section from category.php file:

<header class="page-header">
    <?php
        the_archive_title( '<h1 class="page-title">', '</h1>' );
        the_archive_description( '<div class="taxonomy-description">', '</div>' );
    ?>
</header><!-- .page-header -->

In case you want to show only Category name as page title, then instead of removing the above code from category.php file, just replace the the_archive_title method with:

printf('<h1 class="page-title">%1$s</h1>', single_cat_title('', false));
  • Thank you so much ! – WQT Sep 26 '19 at 17:54
0

To add to the previous answer, if you don't want to remove/add code to the PHP file, you can also add this via CSS to hide that section:

.category h1.page-title {
    display: none;
}

You can add this to style.css or go to Customize > Additional CSS

  • Thank you for that additional solution ! – WQT Sep 26 '19 at 17:54
  • This did not work for me. Maybe it depends on the theme? I use traveler-blog-lite. – user1073075 Oct 11 '19 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.