Hi , how can I move the comment field from after the comments to before the comments? I have some posts with nearly 200 comments and I want people to be able to comment immediately not after scrolling for 30 min…
see screenshot below
Thanks!
Hi , how can I move the comment field from after the comments to before the comments? I have some posts with nearly 200 comments and I want people to be able to comment immediately not after scrolling for 30 min…
see screenshot below
Hello @klelietta,
Thanks for writing in!
This request requires custom development that is already beyond the scope of our support. We are unable to provide support for customizations under our Support Policy.
To get you started, you will need to install a child theme. Copy the file wp-content/themes/x/framework/views/{your-stack}/comments.php and then upload it to your child theme’s folder to wp-content/themes/x-child/framework/views/{your-stack}/comments.php. On the file contents, you will have to relocate the comment form before the comments lists.
Take for example if you are using the Integrity stack. The contents of comments.php file is this:
<?php
// =============================================================================
// VIEWS/INTEGRITY/WP-COMMENTS.PHP
// -----------------------------------------------------------------------------
// The area of the page that contains both current comments and the comment
// form. The actual display of comments is handled by a callback to
// x_comment().
// =============================================================================
//
// 1. If the current post is protected by a password and the visitor has not
// yet entered the password, we will return early without loading the
// comments.
//
if ( post_password_required() )
return; // 1
?>
<div id="comments" class="x-comments-area">
<?php if ( have_comments() ) : ?>
<h2 class="h-comments-title"><span><?php _e( 'Comments' , '__x__' ); ?> <small><?php echo number_format_i18n( get_comments_number() ); ?></small></span></h2>
<ol class="x-comments-list">
<?php
wp_list_comments( array(
'callback' => 'x_integrity_comment',
'style' => 'ol'
) );
?>
</ol>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
<nav id="comment-nav-below" class="navigation" role="navigation">
<h1 class="visually-hidden"><?php _e( 'Comment navigation', '__x__' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', '__x__' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', '__x__' ) ); ?></div>
</nav>
<?php endif; ?>
<?php if ( ! comments_open() && get_comments_number() ) : ?>
<p class="nocomments"><?php _e( 'Comments are closed.' , '__x__' ); ?></p>
<?php endif; ?>
<?php endif; ?>
<?php
comment_form( array(
'comment_notes_after' => '',
'id_submit' => 'entry-comment-submit',
'label_submit' => __( 'Submit' , '__x__' )
) );
?>
</div>
You can move the comment_form() function to the top:
<?php
// =============================================================================
// VIEWS/INTEGRITY/WP-COMMENTS.PHP
// -----------------------------------------------------------------------------
// The area of the page that contains both current comments and the comment
// form. The actual display of comments is handled by a callback to
// x_comment().
// =============================================================================
//
// 1. If the current post is protected by a password and the visitor has not
// yet entered the password, we will return early without loading the
// comments.
//
if ( post_password_required() )
return; // 1
?>
<div id="comments" class="x-comments-area">
<?php
comment_form( array(
'comment_notes_after' => '',
'id_submit' => 'entry-comment-submit',
'label_submit' => __( 'Submit' , '__x__' )
) );
?>
<?php if ( have_comments() ) : ?>
<h2 class="h-comments-title"><span><?php _e( 'Comments' , '__x__' ); ?> <small><?php echo number_format_i18n( get_comments_number() ); ?></small></span></h2>
<ol class="x-comments-list">
<?php
wp_list_comments( array(
'callback' => 'x_integrity_comment',
'style' => 'ol'
) );
?>
</ol>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
<nav id="comment-nav-below" class="navigation" role="navigation">
<h1 class="visually-hidden"><?php _e( 'Comment navigation', '__x__' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', '__x__' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', '__x__' ) ); ?></div>
</nav>
<?php endif; ?>
<?php if ( ! comments_open() && get_comments_number() ) : ?>
<p class="nocomments"><?php _e( 'Comments are closed.' , '__x__' ); ?></p>
<?php endif; ?>
<?php endif; ?>
</div>
Hope this helps.
Hi, Thanks for your help! I followed the instructions and edited the wp-comments.php for my stack (ethos) but so far nothing has changed… this is what I did on the file (put that part on top as you suggested), did I do something wrong? After edit this I saved it where it already was :
FINAL EDIT: Resolved, thanks 
I must have done something wrong because on one of my websites www.keepcalmandtravel.com the comment section disappeared except for a random post, this one: https://www.keepcalmandtravel.com/how-to-monetize-a-travel-blog-top-3-easy-strategies-that-really-work/#comments
On the rest of the blog I can’t see anything.
After a while, it seems that all the posts have caught up, but now I did the same for my other website www.cleliamattana.com and nothing happened. It’s weird.
Hi @klelietta,
Great if the issue is resolved now, please let us know if you are still facing the issue.
Thanks
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.