Remove New Topic Button

How can I remove the New Topic button from the main page? I only want it to appear when a user selects a category.

1 Like

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.

Screen Shot 2020-04-15 at 9.04.12 AM

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;
}
3 Likes

I appreciate the help, however that removes the new topic button from all pages. I want it removed from just the home page.

2 Likes

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.

2 Likes

… such as body.navigation-topics, body.navigation-categories { #create-topic { ... } }.

6 Likes

Thank you Kane, that was very helpful.

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