Title: Adding Create New Topic button
Last modified: February 24, 2020

---

# Adding Create New Topic button

 *  Resolved [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/)
 * I asked about this before, but I have just stumbled on the `[bbp-topic-form]`
   shortcode!
 * It does exactly what I want! It shows the new topic form and includes a drop-
   down list of forums.
 * So I have created new page on my website.
 * My issue is (and I am using the bbp style pack theme):
 * 1. I need to add a Create New Topic button on the main forum index page (same
   look and feel as the Search button.
 * 2. This button should only be visible on the forum index page when the user is
   logged in and is not blocked.
 * I just need a button or hyperlink styles like a button that when clicked goes
   to my new-topic page.
 * Please advise. Thanks.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fadding-create-new-topic-button%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 14 replies - 1 through 14 (of 14 total)

 *  Thread Starter [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12475465)
 * At the moment I get a nice “Create new topic” button when I am on an actual forum
   page.
 * I now need this same button at the top of the main forums index page that is 
   linked to my new “new-topic” page. I even see this as a excellent tweak to bbp
   style pack.
 *  Thread Starter [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12475522)
 * As an attempt to solve this myself I have create a basic widget that links to
   the page. It you look at my side bar you will see it.
 * I think it will do. Ideally this widget should only show if the user is logged
   in but I don’t know how to do that with the widget I have.
 *  Plugin Author [Robin W](https://wordpress.org/support/users/robin-w/)
 * (@robin-w)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12476528)
 * if you add the ‘widget logic’ plugin, you can control when widgets display
 * [https://wordpress.org/plugins/widget-logic/](https://wordpress.org/plugins/widget-logic/)
 * otherwise paste the code for your widget, and I’ll add the logic
 *  Thread Starter [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12476640)
 * Thanks. It is a “Custom HTML” widget at the moment:
 *     ```
       <ul class="ts-downloads-widget">
       	<li>[fas-plus-circle] <a href="https://www.publictalksoftware.co.uk/new-topic/">Create New Topic</a></li></ul>
       ```
   
 * I would like to avoid installing the plugin if poss.
    -  This reply was modified 6 years, 3 months ago by [Chuckie](https://wordpress.org/support/users/ajtruckle/).
    -  This reply was modified 6 years, 3 months ago by [Chuckie](https://wordpress.org/support/users/ajtruckle/).
    -  This reply was modified 6 years, 3 months ago by [Chuckie](https://wordpress.org/support/users/ajtruckle/).
 *  Plugin Author [Robin W](https://wordpress.org/support/users/robin-w/)
 * (@robin-w)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12476756)
 * it’s not possible to run php code in the standard widgets, so logic or a pho 
   widget such as
 * [https://wordpress.org/plugins/php-code-widget/](https://wordpress.org/plugins/php-code-widget/)
 * is needed
 *  Thread Starter [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12476775)
 * Ok, I have installed “Widget Logic” to test this on my staging site. What logic
   do we need here?
 * Thanks.
 *  Thread Starter [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12476859)
 * I assume it is similar to what you suggested in bbPress forum for user statistics.
 * Something like:
 * `is_user_logged_in() && is_bbpress() && current_user_can( 'spectate' )`
 * But I am not exactly sure of the complete content I should input into that logic
   box.
 *  Plugin Author [Robin W](https://wordpress.org/support/users/robin-w/)
 * (@robin-w)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12476899)
 * that should work, it’s a while since I’ve used that plugin, so you’ll need to
   have aplay and see what works
 *  Thread Starter [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12477006)
 * If I use the `is_user_logged_in()` bit it works. But the moment I extend it:
 * `return (is_user_logged_in() && is_bbpress());`
 * It doesn’t work.
 *  Plugin Author [Robin W](https://wordpress.org/support/users/robin-w/)
 * (@robin-w)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12477299)
 * just
 * `is_user_logged_in() && is_bbpress())`
    -  This reply was modified 6 years, 3 months ago by [Robin W](https://wordpress.org/support/users/robin-w/).
 *  Thread Starter [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12477505)
 * Seems missmatch in the ( ) characters there?
 * It does not like using `is_bbpress()`
    -  This reply was modified 6 years, 3 months ago by [Chuckie](https://wordpress.org/support/users/ajtruckle/).
 *  Thread Starter [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12478098)
 * I will stick with `is_user_logged_in`. It is sufficient.
 * Thank you.
 *  Thread Starter [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12478679)
 * Just occurred to me. What exactly is `is_bbpress()` checking for?
 *  Thread Starter [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * (@ajtruckle)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12478742)
 * That is why:
 * [http://hookr.io/functions/is_bbpress/](http://hookr.io/functions/is_bbpress/)
 * This limits to bbPress pages. Don’t want that limit.
 * That why I did not see widget on homepage.
 * No need to test for blocked as I assume blocked not allow to create topic.

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Adding Create New Topic button’ is closed to new replies.

 * ![](https://ps.w.org/bbp-style-pack/assets/icon-256x256.jpg?rev=2706563)
 * [bbp style pack](https://wordpress.org/plugins/bbp-style-pack/)
 * [Support Threads](https://wordpress.org/support/plugin/bbp-style-pack/)
 * [Active Topics](https://wordpress.org/support/plugin/bbp-style-pack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bbp-style-pack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bbp-style-pack/reviews/)

 * 14 replies
 * 2 participants
 * Last reply from: [Chuckie](https://wordpress.org/support/users/ajtruckle/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/adding-create-new-topic-button/#post-12478742)
 * Status: resolved