admin管理员组

文章数量:1124801

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 :)

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 :)

Share Improve this question edited Feb 20, 2024 at 16:39 Jesse Nickles 7357 silver badges19 bronze badges asked Sep 26, 2019 at 15:03 WQTWQT 131 silver badge4 bronze badges 1
  • Related: wordpress.stackexchange.com/questions/179585/… – Jesse Nickles Commented Feb 19, 2024 at 8:10
Add a comment  | 

3 Answers 3

Reset to default 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));

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

To stop category title from displaying in the front end post. just follow below steps. Add this line to additional CSS

.cat-links { display: none; }

本文标签: categoriesHow to remove quotCategoryquot title prefix in Twenty Sixteen theme