BBPRESS: SEPARATE "START NEW TOPIC" FORM

Hi Everybody,

I'm working with bbPress on my website, and I'm currently trying to create a "start new topic" form on its own page (https://example.com/start-new-topic) without the dropdown menu.

So if a user was on Category: General Purpose -> Forums: Discussion and they click the "start new topic" link, they'd be redirected to the /start-new-topic and that form will post directly to Forums: Discussion.

This is practically what I want: https://premium.wpmudev.org/forums/topic/im-interested-if-there-is-a-way-to-add-start-new-topic but I tried to use the solution that Sajid provided, but it didn't work.

I'm hoping that someone in the community can help me out, and please don't hesitate to ask me more questions.

Thank You,
Michael

Additional Information:

This is my post in the previous discussion:
----------------------------
Hi Sajid,

I'm hoping you can help me here.

I put these in my loop-forums.php file:

<?php echo do_shortcode('[bbp-topic-form forum_id='.bbp_get_forum_id().']'); ?>

https://example.com/create-new-topic/?ForumId=<?php echo bbp_get_forum_id()?>

I have a page with the URL below that I put your shortcode in

https://example.com/create-new-topic

and I've downloaded the file you had in your post, extracted it, and uploaded the file to mu-plugins.

And it isn't working. I'm pretty sure I missed something. If you could help out, that'd be fantastic!

Thank You,
Michael

-------------------------

To clarify, the form is working, but it still has the drop down menu.

  • Sajid

    Hello Michael,
    Hope you are doing good and thanks for creating a new topic as requested.

    I tested my own code again on my own site and its working the way it is should.

    First of all you don't need below code in the loop-forums.php file unless you want to show the form on same page that actually defeats the purpose of this custom code snippet.
    <?php echo do_shortcode('[bbp-topic-form forum_id='.bbp_get_forum_id().']'); ?>

    There are thee sections of this code listed below.

    1. Add the following code in a template files like loop-forums.php to generated the link/button to create a new topic:
    <a href="http://domain.dev/create-new-topic/?ForumId=<?php echo bbp_get_forum_id()?>">Create New Topic</a>

    Please note that, you have to add the code in bbPress loop in loop-forums.php file between these two lines.
    `<?php while ( bbp_forums() ) : bbp_the_forum(); ?>

    <?php endwhile; ?>`

    Or anywhere in loop-single-forum.php template file.

    NOTE: Its recommended to override bbPress templates instead of editing the plugin core files. See this topic for details and easy instructions:
    https://bbpress.org/forums/topic/correct-way-to-override-bbpress-templates/

    2. Download the mu-plugin attached with this reply and move it to wp-content/mu-plugins folder.

    3. Create a page and add the following shortcode in the page content to render the form according to link.
    [wpmu_bbp_topic]

    Hope that helps! If you still need help then please tell me where exactly you want the button to appear and send in FTP and WordPress admin details so I could make that change for you.

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid - WPMU DEV Support

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.