Skip to:
Content
Pages
Categories
Search
Top
Bottom

New Topic Button at top of topic, and Topic Creation on Separate Page


  • MarximusMG
    Participant

    @marximusmg

    As can be seen here: http://www.highexistence.com/discussions/

    I’m wanting to add a button to the top of the forum list view, as well as each topic, that allows the user to create a new topic by clicking it.

    Additionally, when this button is clicked, I’d like it to function similarly to the link above, in that it loads a new page where the user can create their topic and choose the forum to post it in through a drop down menu that displays all the available forums.

    Thank you in advance for any help!

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

  • Robkk
    Moderator

    @robkk

    they use , the bbpress shortcode for the new topic form.

    [bbp-topic-form] – Display the ‘New Topic’ form where you can choose from a drop down menu the forum that this topic is to be associated with.

    more shortcodes https://codex.bbpress.org/shortcodes/

    create a page , lets say “new topic”

    add that shortcode, and save

    place an html link in loop-forums.php

    the link should look like

    <a href="http://sitename.com/new-topic/">New Topic</a>

    style it with css with

    a.bbp-new-topic-button {
    background:#009375;
    color:#fff;
    }

    MarximusMG
    Participant

    @marximusmg

    Thank you SO much robkk.

    At the risk of sounding like a complete newbie (which I definitely am), I’m getting stuck at placing the link in loop-forums.php. What would that line of code look like, using the sample New Topic URL?


    Robkk
    Moderator

    @robkk

    copy loop-forums.php in your child theme

    then i think it should be placed above

    <li class=”bbp-header”>

    it wont be exactly like the button on the other site but it should you should get the gist of it.


    MarximusMG
    Participant

    @marximusmg

    Thank you, but what would the actual line of code that should be entered there look like? Again, I apologize for the basic question, and I truly appreciate your help! 🙂


    Robkk
    Moderator

    @robkk

    <a href="http://yoursitename.com/new-topic/">New Topic</a>

    this should work after you have done everything in

    New Topic Button at top of topic, and Topic Creation on Separate Page


    MarximusMG
    Participant

    @marximusmg

    Thank you. I should have clarified, I was able to place the HTML link above <li class=”bbp-header”>, but I wasn’t sure as to how I would have this link appear as a button instead of just the link as text, and how to associate that button with the CSS selector a.bbp-new-topic-button


    Robkk
    Moderator

    @robkk

    Well its not actually a “button” , it won’t come with a 3-D look and other styles automatically based on how your theme styles a standard button , but I mean you could do that with CSS I think. I just created a link and just added padding , background and font color , and a :hover version to look like a nice flat button.

    If you want a more button look you add gradients , or add the input type button parameter in css


    MarximusMG
    Participant

    @marximusmg

    Thanks for the help! As I mentioned earlier, I was just having a complete newbie moment with regards to assigning a class to the link. I had all the css styling pointing toward a class, but didn’t assign a class to the link, so was getting nowhere. Got it all fixed now, thanks!


    MarximusMG
    Participant

    @marximusmg

    Do you know how I would go about hiding the “Create New Topic” form at the bottom of the page, now that I’ve made the link at the top to go to the “New Topic” standalone page?

    I thought of setting using display:none; for .bbp-form, but wouldn’t that hide all instances of that?


    Robkk
    Moderator

    @robkk

    Do you know how I would go about hiding the “Create New Topic” form at the bottom of the page, now that I’ve made the link at the top to go to the “New Topic” standalone page?

    copy content-single-forum.php into your bbpress folder
    and delete any instance that say <?php bbp_get_template_part( 'form', 'topic' ); ?>

    that should do it


    MarximusMG
    Participant

    @marximusmg

    works perfectly, thanks @robkk!


    Robkk
    Moderator

    @robkk

    @marximusmg no problem


    Mizagorn
    Participant

    @mizagorn

    @robkk thanks for being so patient. This helped me find out how to add a new topic area as well. Nice work! 🙂

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.
Skip to toolbar