# 隐藏特定分类的面包屑

**URL:** https://meta.discourse.org/t/hide-category-breadcrumb-from-a-specific-category/269524
**Category:** Development
**Created:** [2023年六月25日 01:42 UTC](https://meta.discourse.org/t/hide-category-breadcrumb-from-a-specific-category/269524 "2023-06-25T01:42:33Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Sami\_Syed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sami_syed/32/93193_2.png) [@Sami\_Syed](https://meta.discourse.org/u/Sami_Syed)
#### Post date: [2023年六月25日 01:42 UTC](https://meta.discourse.org/t/hide-category-breadcrumb-from-a-specific-category/269524/1 "2023-06-25T01:42:33Z")

</div>

如何从特定类别中隐藏整个类别面包屑部分？

我想隐藏整个部分：

 ![Screenshot 2023-06-24 214223](https://global.discourse-cdn.com/meta/original/4X/8/7/9/8799334ccc86ad15b1a816b0b355a40c4e86addb.jpeg)

我尝试了以下方法，但无效：

```plaintext
body[class*='category-myCategorySlug-'] ol.category-breadcrumb li.tag-drop {
    display: none;
}

```

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2023年六月25日 02:38 UTC](https://meta.discourse.org/t/hide-category-breadcrumb-from-a-specific-category/269524/2 "2023-06-25T02:38:56Z")

</div>

你好 @Sami_Syed

这些是类别面包屑下拉菜单和导航栏（或 nav bar）。

要隐藏它们，请在通用 CSS 中尝试此操作：

```scss
.category-[category-slug] .category-breadcrumb,
.category-[category-slug] #navigation-bar {
    display: none;
}

```

如果你还想包含导航控件按钮（管理员扳手、新主题按钮和警报按钮），可以这样做：

```scss
.category-[category-slug] .navigation-container {
    display: none;
}

```

---

<div class="post-metadata">

### Author: ![Sami\_Syed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sami_syed/32/93193_2.png) [@Sami\_Syed](https://meta.discourse.org/u/Sami_Syed)
#### Post date: [2023年六月25日 18:30 UTC](https://meta.discourse.org/t/hide-category-breadcrumb-from-a-specific-category/269524/3 "2023-06-25T18:30:09Z")

</div>

> [@Lilly](#):
>
> ```plaintext
> .category-[category-slug] .category-breadcrumb,
> .category-[category-slug] #navigation-bar {
> display: none;
> }
> 
> ```

我试过了，但它不起作用。

 ![Screenshot 2023-06-25 142920](https://global.discourse-cdn.com/meta/original/4X/9/7/5/9751744ca9567ba3deebc451cf894d439461f0a5.jpeg)

这是我试图从中删除它的类别的 URL。[https://vanlifesummit2.discoursehosting.net/c/van-life-summit/perks/6](https://vanlifesummit2.discoursehosting.net/c/van-life-summit/perks/6)

我有一个单独的主题组件，它在当前主题中是活动的。

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2023年六月25日 18:38 UTC](https://meta.discourse.org/t/hide-category-breadcrumb-from-a-specific-category/269524/4 "2023-06-25T18:38:12Z")

</div>

哦，这是一个子类别。给你：

```scss
.category-van-life-summit-perks .category-breadcrumb,
.category-van-life-summit-perks #navigation-bar {
    display: none;
}

```

用“-”分隔类别和子类别 slug

---

<div class="post-metadata">

### Author: ![Sami\_Syed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sami_syed/32/93193_2.png) [@Sami\_Syed](https://meta.discourse.org/u/Sami_Syed)
#### Post date: [2023年六月26日 00:19 UTC](https://meta.discourse.org/t/hide-category-breadcrumb-from-a-specific-category/269524/5 "2023-06-26T00:19:29Z")

</div>

这奏效了。谢谢 @Lilly

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2023年六月26日 01:20 UTC](https://meta.discourse.org/t/hide-category-breadcrumb-from-a-specific-category/269524/6 "2023-06-26T01:20:00Z")

</div>

随时 🙂 很高兴能帮到你。

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2023年七月26日 01:20 UTC](https://meta.discourse.org/t/hide-category-breadcrumb-from-a-specific-category/269524/7 "2023-07-26T01:20:51Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
