WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Add comments box above comments. (9 posts)

  1. comedorsamus
    Member
    Posted 3 years ago #

    Is it possible to move the 'add comments' form to above the comments?

    If you have a post with more than 50 replies it may become a problem because the 'add comments' box will be pushed to the bottom of the page.

    I've been playing with comments.php for a while now, but to no avail...

    Help? *-*

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    can you paste the code of your comments.php into a http://wordpress.pastebin.com/ and post the link to it here?

    generally, you could just add <?php comments_form(); ?> to your comments.php where you want the form to show - however, details depend on your existing code.

  3. comedorsamus
    Member
    Posted 3 years ago #

    Pastebin doesn't seem to be working right now, and I don't think I'm allowed to copy/paste my code here, right?

    Well here's the link to my blog:

    http://beyoncenoticias.com/coluna-da-billboard-lista-beyonce-como-uma-das-marcas-na-decada-de-2000/

  4. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    thanks, i downloaded the theme to get the comments.php;

    as far as i can see, you can take everything from (and including):

    <?php if ('open' == $post->comment_status) : ?>
    
    <div id="respond">

    to including:

    <?php endif; // If registration required and not logged in ?>
    </div>
    
    <?php endif; // if you delete this the sky will fall on your head ?>

    and move it up to just below:

    <!-- You can start editing here. -->
    <div class="comments" id="comment">
    
    /*CODE MOVED TO HERE*/

    there could be the 'problem' if someone clicks on the comments link of the post on the frontpage, the anchor will jump to the headline of the comments, which will be below the comments form after the changes - so viewers are likely to miss the new position of the comments form.

    to resolve this, you may need to move the anchor point id="comments" to a new position; i.e. remove it from this line:
    <h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</h3>

    and add it to this line into the h3 tag:

    <h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>

    you could also add a anchor link at the bottom to point to the comments form at the top:

    <?php if ('open' == $post->comment_status) : ?>
    <span class="up-to-comment"><a href="#comments">Back Up to Leave a Reply</a></span>
    <?php endif; ?>

    the whole lot is in:
    http://wordpress.pastebin.ca/2005917

    make a backup copy before editing theme files

  5. comedorsamus
    Member
    Posted 3 years ago #

    Thank YOU. T_T

    OH LORD! That was amazing, works like a charm! Thanks once again and have a nice day!

  6. Chukwudi Emmanuel Udegbunam
    Member
    Posted 3 years ago #

    Thanks man. It worked pretty well for me too ;-)

  7. Jassim
    Member
    Posted 3 years ago #

    I am still struggling to figure this out. The above pastebin link also not working. Please somebody help me. I want to place the comments below comment box. Thanks

  8. Chukwudi Emmanuel Udegbunam
    Member
    Posted 3 years ago #

    @Jassim: Follow alchymyth's instructions to the letter. It works.

  9. mileseze
    Member
    Posted 2 years ago #

    It also worked on me. Thanks alchymyth.

Topic Closed

This topic has been closed to new replies.

About this Topic