Notifications
Clear all

Script [Solved] Add topic button in forum description

5 Posts
3 Users
2 Reactions
1,058 Views
VereK
Posts: 522
Topic starter
(@verek)
Honorable Member
Joined: 7 years ago

As per the title. Is there a way to add an "Add topic" to the forum description in Extended and Simplified forums?. It would greatly enhance usability for mobile users in particular. 

4 Replies
Robert
Posts: 10590
Admin
(@robert)
Support Team
Joined: 9 years ago

Hi

1. Go to Dashboard > Forums > Forums admin page and find Forum IDs.

2. Create the [Add Topic] button HTML code and put the ForumID in the button URL, in my example the forum id is 19:

https://  example.com  / community/ add-topic / forumid /

<p style="margin:7px 0;">
<a href="https://wpforo.com/community/add-topic/19/" class="wpf-button">Add Topic</a>
</p>

3. Put this HTML code in corresponding forum description.

 

VereK
Posts: 522
Topic starter
(@verek)
Honorable Member
Joined: 7 years ago

Fantastic. Thank you Robert

Edit: Just add this CSS if you want to hide these buttons from guests (Check 

/* Hide Add topic for guests in forum description */
#wpforo #wpforo-wrap.wpf-guest div > div.wpforo-forum-info > p:nth-child(3) > a {display:none;}
Vít Hofman
Posts: 139
(@vit-hofman)
Estimable Member
Joined: 6 years ago

@Robert In the menu for adding the item "Add topic" I can use this link: "/% wpforo-add-topic% /"

Is there any way to make it work for any button on the web?

If I use the link "/community/add-topic/" it works only for logged in users. The unlogged-in user only sees a notification that he does not have permission to go to the page.

Ideally, an unlogged-in user would be directed to the login page, as in the case of the "/% wpforo-add-topic% /" link.

Thanks.

1 Reply
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10590

@vit-hofman,

I'm sorry but I didn't follow you.