Jump to content

Archived

This topic is now archived and is closed to further replies.

ovidiuav

Move comment form above comments

Recommended Posts

ovidiuav

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
Rob

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.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
ovidiuav

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
Rob

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.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
FionaFell

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
Danny

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


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
dwiut
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
Danny

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.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Simon
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

  • Similar Content

    • werdnags
      By werdnags+
      I know this does not have anything to do with Pagelines directly but this is happening on my PL5 site.  At the bottom of my blog posts I have put the Facebook Comments Plugin and it works well but when people are leaving comments they are the same for every post.  Does anyone have any idea on how to solve this so the comments are for the post they are on.  Does that make sense? Ha!
      Thanks for any ideas folks.
    • Steve Webb
      By Steve Webb+
      I am having an issue with DMS editor not loading.  Just keeps spinning and spinning.
      Have tried several things - Logged in and out, cleared cache, deactivated all plugins, but the issue persists.
      I even had our host restore from a backup a few weeks ago, when I know it WAS working, as I edited a text box on the homepage.  The restore from backup didn't help either.
      Also, the front end of the site shows that the site is framed, or boxed now (whatever you call it), instead of full width as it was previously (last week).
      Dev console shows that there are php errors in Google maps - file is attached.
      Can someone please help?  Not sure what else I can do here...
      Thanks in advance.
      -Matt

    • tuciudadenred
      By tuciudadenred+
      Hi everyone, what happens is that the web page metrosalarmas.com has a google tags which I have not attacked where I can look to remove those tags and be able to locate the correct ones.
    • Steve Webb
      By Steve Webb+
      I am having an issue with DMS editor not loading.  Just keeps spinning and spinning.
      Have tried several things - Logged in and out, cleared cache, deactivated all plugins, but the issue persists.
      I even had our host restore from a backup a week ago, when I know it WAS working, as I edited a text box on the homepage.  The restore from backup didn't help either.
      Also, the front end of the site shows that the site is framed, or boxed now (whatever you call it), instead of full width as it was previously (last week).
      Dev console shows that there are php errors in Google maps - file is attached.
      Can someone please help?  Not sure what else I can do here...
      Thanks in advance.
      -Matt

    • JawDesigns
      By JawDesigns
      Hi everyone,
      Flywheel have reported errors on my clients site 'www.racewaredirect.co.uk' and it's not loading. Can someone please provide some information on how to fix this? The site has never experienced these issues before.
      Thanks,
      James Wilson
×