Hide 'Create Topic' on home page?

Is it possible to hide the ‘create topic’ button on the home page?

i would like my users to navigate to the appropriate category/subcategory before posting a topic, because then the correct category option is automatically placed in the composer, instead of having to scroll through what will be hundreds of categories and subcategories in the drop down menu looking for the right one.

Does anybody know how to do this please?

Try this CSS Rule

body:not([class*='category-']) #create-topic {
    display: none;
}

It will only let the create-topic button appear on category pages.

Yes cpradio, absolutely perfect, top notch support.

many thanks.

actually, can the code be tweeked to show the ‘create topic’ button also in category>subcategory>tag?

Just to confirm, you have show filter by tag enabled?

i do indeed have it enabled.

so when someone goes to service(category)>county(subcategory)>town(tag) the create topic button is shown.

K, this is what you will want then

body:not([class*='category-']) #create-topic {
    display: none;
}

body.tags-page #create-topic {
    display: block;
}

Yes, The ‘create topic’ button now shows up on the page when a tag is selected.

absolute genius. i love you guys.

This populates the composer with the correct category and the correct tag.

:+1:

我也代表@cpradio 表示感谢,这作为一个功能会非常棒。可惜在移动设备上无法使用::pensive:

我已经尝试了所有方法,但依然不明白如何在移动设备上隐藏“创建话题”按钮。在小屏幕上浏览分类和标签很困难,这个功能将大有帮助,为何不在菜单中添加一个选项呢?:smiley:

你可以使用浏览器的样式检查器。它会显示该声明在移动设备上被一个更具体的声明覆盖了:

因此,你可以选择自行使用针对移动设备的更具体声明:

body:not([class*="category-"]) .list-controls .container #create-topic {
    display: none;
}

或者通过 !important 属性让你的通用声明获得更高优先级:

body:not([class*="category-"]) #create-topic {
    display: none !important;
}

谢谢 @manuel,我使用了!important 属性,现在完美运行了!