Support » Fixing WordPress » Add comments box above comments.

  • Resolved comedorsamus


    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? *-*

Viewing 8 replies - 1 through 8 (of 8 total)
  • Michael


    Forum Moderator

    can you paste the code of your comments.php into a 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.

    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:



    Forum Moderator

    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 ?>
    <?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">

    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:

    make a backup copy before editing theme files

    Thank YOU. T_T

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

    Thanks man. It worked pretty well for me too 😉

    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

    @jassim: Follow alchymyth’s instructions to the letter. It works.

    It also worked on me. Thanks alchymyth.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Add comments box above comments.’ is closed to new replies.