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 4 replies - 1 through 4 (of 4 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!

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