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 :)
- Related: wordpress.stackexchange.com/questions/179585/… – Jesse Nickles Commented Feb 19, 2024 at 8:10
3 Answers
Reset to default 1That 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
版权声明:本文标题:categories - How to remove "Category:" title prefix in Twenty Sixteen theme? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736644760a1946077.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论