How can I remove the New Topic button from the main page? I only want it to appear when a user selects a category.
I don’t know if there is a simple way to do it.
You may want to look at this in order to add a page-specific class to the page body: Address /latest differently then /new etc via CSS
And then, target the create button through this css class to hide it where you want.
You can add this to your theme CSS:
button#create-topic{
display:none;
}
Please note, for future reference, that you can simply right click on any item in a web page and select Inspect
and a web developer window will appear where the element is highlighted.
Then, you can quickly see that the button
element has the unique id, create-topic
.
(So quickly in fact, that it takes less time to inspect the element, write and insert a few lines of CSS into your theme, than the time it takes to post a question in any forum and wait for a reply, thus saving you a lot of time and giving you the satisfaction of mastering these small tasks.)
With this information, you can easily create a selector in CSS:
button#create-topic
This CSS selector means (in a nutshell) “select the button element with unique id create-topic”.
After you select it, you can easily hide it, it change the color, font, size, etc. as you like.
button#create-topic{
display:none;
}
I appreciate the help, however that removes the new topic button from all pages. I want it removed from just the home page.
Then, I kindly suggest you go to your home page and look for a CSS element unique to that page and create your own CSS selector to change the element on that particular page.
That is why I took the time to describe to you, in some details, how to do it; so you can do it yourself.
… such as body.navigation-topics, body.navigation-categories { #create-topic { ... } }
.
Thank you Kane, that was very helpful.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.