• 0

Move comment form above comments


Question

Posted · Report post

Hi! Can someone please tell me how I can move the comment form above the actual comments? Please note that I only want to do this for one page.

 

I've managed to reverse the comments' order for that specific page by editing init.php, now I'm guessing I have to edit comments.php and have the comment form show up before the comments for that specific page ID only, but I haven't been able to find any help on how to do this.

 

Thanks in advance!

Share this post


Link to post
Share on other sites

9 answers to this question

  • 0

Posted · Report post

Please don't modify core files, and more so, don't tell others how to, or that they should do it.  That not only violates your license, but it also endangers others websites.  Thanks.

 

Folks, don't do what is posted above. You could lose your support.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi, that has to be done by editing Wordpress comments.php file.  It is not a PageLines issue as we don't layout the way WordPress structures its comment form.  However, I know of some who've done this. Unfortunately, I'm not sure how, or if it's really safe as each WordPress update would likely overwrite it.

 

Look to WordPress.org's forums for some guidance as you're not the only one to ask.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Actually, I've managed to do it and not by editing any Wordpress file, but DMS' comments.php. I'm going to post the solution here, should anyone ever want to do this as well.

 

I added the following code before if ( have_comments() ) : ?> in comments.php:

 

if ($id == PAGEID) {
comment_form();
}

 

After I did this, the comment form on the page would show up both above and under the comments, so I added the following code after endif; // end have_comments() and before the last two </div>:

 

if ($id == PAGEID) {
}
else {
comment_form(); } ?>

 

Works like a charm. I'm aware that an update to DMS will overwrite comments.php, but manually inserting these few lines of code will only take one minute.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Any chance of adding that option as a feature, so we don't have to mess with core code?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I don't think there is a need for it. Not many people will want to have the comments form above the Comments, in my opinion it defeats the object, you read the comments then have to scroll back up to make a new comments, sounds odd to me.

You can however, use a hook to add a comments form above as well as being below the comments. You will need to use this in your hook - http://codex.wordpress.org/Function_Reference/comment_form

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Somebody could re-answer this topic. I want to move comment box to top before visitor's comments. Because latest comment on top, I think is not too odd for me. I'm not good in coding so give me simple solution or by third plugin.
Thanks in advance.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi,

 

As far as I am aware there is no simple solution or a plugin that can achieve this, you will need to follow the instructions I gave you above and use a hook.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

thanks Danny

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

If you create a child theme and put the commets file inside that it will be protected against updates to dms

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now