WordPress: Comment Box above Comments


How to move the Comment Box from the bottom of the comments to the Top?

Some people prefer the comment box at the bottom, and that is the default position for WordPress.


These Adverts help to pay for this site.

However, I have found that many people ask questions without looking at the other comments, and add their comment or question as a reply to someone else comment, as they never reach the new comment box.

So, I needed to move the comment box code to a different position in the comments.php file.

The comments.php file, the template for displaying comments is in the /wp-content/themes/twentysixteen folder, or whatever your theme is called.

This is the code that needs to be moved:

<?php
	comment_form( array(
		'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">',
		'title_reply_after'  => '</h2>',
	) );
?>

It needs to be placed between the


Agoda HolidaysAgoda HolidaysThese Adverts help to pay for this site.
<?php the_comments_navigation(); ?>

and the

<?php ol class="comment-list"(); ?>

lines.

It ends up as:

<?php the_comments_navigation(); ?>
<?php
	comment_form( array(
		'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">',
		'title_reply_after'  => '</h2>',
	) );
?>

<?php ol class="comment-list"(); ?>

I copied the file from the /wp-content/themes/twentysixteen folder to the /wp-content/themes/twentysixteenchild folder, to avoid the change being lost when twentysixteen is upgraded.

 


2.1 - 538,293
DreamHost

Scroll down for Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.