类别弹头类的WordPress问题

我为帖子中显示的每个类别添加了标题颜色。 This is how I want it to be displayedthis is the way it displays

它在一个类别页面https://everythingstudent.co.uk/category/discounts/上正常工作,但在其他类别页面上https://everythingstudent.co.uk/category/sponsored/上则无效-如果您错过了该页面,则后面的部分。

我不明白为什么它不尊重分配的CSS。它使我烦恼。

kyo0616 回答:类别弹头类的WordPress问题

您的CSS在哪里输入?您是手动还是通过前端编辑器完成的? 根据我的经验,很多时候它就像主题兼容性问题一样简单,因此您可能必须直接进入主题本身的源代码。 让我知道一些细节,我应该能够详细说明

,

您犯了个小错误。只需将您的CSS替换为下面的CSS。正文和文章标签中的类相同,因此我们需要添加带有类名的文章标签,以免与正文标签冲突:)

article.category-discounts .category_es_title {
    background-color: #0072bc!important;
}

article.category-anothercat .category_es_title {
    background-color: #f8ac87!important;
}

article.category-jackiscool .category_es_title {
    background-color: #75d3f6!important;
}

article.category-sponsored .category_es_title {
    background-color: #00a651!important;
}

article.category-student-life .category_es_title {
     background-color: #ff1744!important;
}
本文链接:https://www.f2er.com/3149997.html

大家都在问