Skip to:
Content
Pages
Categories
Search
Top
Bottom

an easy New Topic button


  • mth75
    Participant

    @mth75

    Hi all,

    I added an easy New Topic button (after reading a lot of other possible solutions):

    New Topic button

    Add to your loop-topics.php template (before the actual loop):

    <?php if (!is_user_logged_in() ) :?>
    <?php else : ?>
    <div class="new-topic">
    	<input type="submit" name="submit" value="New Topic"  onclick="location.href='#new-post';">
    </div>
    <?php endif; ?>

    Add some css for styling when needed:

    .new-topic {  
    	position: relative;
    	z-index:1;
    	float: right;
    }

    Regards,

    Marc

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

  • namruf15
    Participant

    @namruf15

    Hello, thank you, really simple and efficient solution. However the button is not showed when the certain forum is empty. I have it only in forums in which at least one topic has been started. Do you have a solution for such issue?


    mth75
    Participant

    @mth75

    @namruff15, thx mate. I like the simple solutions as well.

    This behaviour (not showing when a forum is empty) is exactly what I wanted (for me it made no sense to have a button above the topic form). I will look into it (if still wanted).

    Regards,

    Marc


    namruf15
    Participant

    @namruf15

    Yes, I suppose that you’re right. It is not necessary to have the button when the text box is on top of the page. For me it’s ok as it is as well. Thanks again!


    mth75
    Participant

    @mth75

    Cool, no thx!


    drjohndimi
    Participant

    @drjohndimi

    Hello Marc.
    I know it’s been 9 months after your last post here.
    Please can you help me 2 or 3 issues:

    1. Topic Form:
    I want to have been able to close the Topic Editor Form appearing at the bottom of a thread after all topics have been listed via this – https://bbpress.org/forums/topic/how-to-hide-new-topic-form-at-the-bottom-of-single-form/

    BUT I would love to have a button that redirects to a New Topic page, just below the listed Topics on a Thread/”forum” – Does your button redirect you to a new page?

    2. Reply Form:
    Similar to No.1 above, I don’t want the Reply Form to show at the bottom of comments if it’s possible (similar to hiding the Topic Form) and having a button at the bottom. However, I was hoping that the button was clicked would open up the form for users to type away (I think it’s called ajaxify)? Any suggestions?\

    3. Any help on this unrelated topic would be great too – No one has responded yet – https://bbpress.org/forums/topic/at-home-page-how-to-list-recent-topics-from-each-forum-under-its-specific-forum/

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