admin管理员组文章数量:1307752
I’m looking for a way to hide a specific category title (not all but just one specific category title) from being displayed on the home page, archives, and search results but still show the posts tagged under the category.
Is it possible to do it via CSS or functions hook?
Keep in mind that I want to hide the category title (not the posts under the category. Just the title) from being displayed on home page, archives, and search results.
However, the category name should be displayed on posts.
I’m looking for a way to hide a specific category title (not all but just one specific category title) from being displayed on the home page, archives, and search results but still show the posts tagged under the category.
Is it possible to do it via CSS or functions hook?
Keep in mind that I want to hide the category title (not the posts under the category. Just the title) from being displayed on home page, archives, and search results.
However, the category name should be displayed on posts.
Share Improve this question edited Jan 21, 2021 at 2:47 fuxia♦ 107k38 gold badges255 silver badges459 bronze badges asked Jan 20, 2021 at 19:52 DeewincDeewinc 531 silver badge4 bronze badges 2- How are these categories being shown? I don't believe it's possible to write a one size fits all answer given that there are so many ways a category might be shown or listed, more information is needed – Tom J Nowell ♦ Commented Jan 20, 2021 at 21:40
- Can you share your current code? As another user commented, the answer to this question will depend on a lot of things, such as whether the listing is currently displayed by your theme, or by your widgets, etc. In general, you may be able to modify the function that's currently being called, and exclude the category title from the display if it matches the category ID you wish to exclude. – nightowl Commented Jan 21, 2021 at 0:37
1 Answer
Reset to default 0This code works perfect. Note that 137
is the category ID
that I wish to hide and .home
is the page where I don't want it to be displayed
.home .entry-category-item-137 {
display: none;
}
本文标签: categoriesHide category name but show posts
版权声明:本文标题:categories - Hide category name but show posts 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741811362a2398814.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论