Jump to content

Archived

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

ovidiuav

Move comment form above comments

Recommended Posts

ovidiuav    0
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    547
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    0
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    547
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    0
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    1,327
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    0
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    1,327
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    247
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

    • 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
    • MissT
      By MissT+
      Hi there,
      I've got an issue with 3 websites built with DMS since I migrated them from http to https that I need help with please.
      When any changes are made - e.g. new posts added or existing posts amended - certain sections of the live site seem to break e.g. image headers hang and don't load (b/g on canvas section), sliders hang and don't load (Revslider), flipper section doesn't load.
      Logging in and then clicking 'Edit the site using DMS' seems to fix the problem. Often if I try to open up another browser window to edit the site / re publish I'm unable to as the page wont load / hangs while trying to load.
      Any ideas how to fix this? On a couple of the sites I've installed a caching plugin as I thought it might be a loading speed issue but it's still happening.
      Website URL's can be provided privately.
      Many thanks in advance.
    • jeomiland
      By jeomiland+
      Hi
      I found this topic
      which talks about a similar issue I am having, but a little different. Hope someone can help me out.
      Best way to see the problem is to view http://cassclayton.com/ on Safari (Mac) compared to Firefox or Chrome. You will see the banner just under the fixed menubar has a gap between the menubar and top of the banner. Looking at Inspector, I found:
      <div class="fixed-top-pusher" style="height: 62px;"></div>
      <script> jQuery('.fixed-top-pusher').height( jQuery('.pl-fixed-top').height() ) </script>
      and indeed it seems the jquery is not always working consistently. For instance, if you simply refresh the page in Safari, it will loose the gap and all looks fine, so is it a browser cache issue that is interacting with the jquery? I do have W3 Total Cache installed. There must be a way to tell the code to make sure jquery is up and running and available to do it's majic?
      And perhaps there is just a better way to do this banner? Originally I tried several DMS sections and used the banner image as background, etc... Kept running into problems with resizing and the left/right parts of the image were getting chopped off. It is important the whole image show, so currently I just use a NextBox section with this code:
      <img src="[pl_site_url]/wp-content/uploads/2015/12/CassClayton-blues-tribute-banner.jpg" width="100%" />
      and it looks the way it should. Is there a better way to place a banner graphic under a fixed navbar and make sure the whole banner graphic displays regardless of screensize?
       
    • oseehys
      By oseehys+
      Hello There,
      So i want to use platform 5 and DMS sections on a single page, i am using a child theme with pinspro as my main theme and i activated platform 5, the only problem am having so far is the fixed option, my navbars are not aligning to their default size, and it will be great if platform 5 header and footer section will function, has anyone used this option, how can i make the best use of platform 5 and DMS on a site
      Cheers
    • kwaoru
      By kwaoru
      Hi,
      I desperately need to deactivate the responsive function on mobile for reasons. It looks so messy with the responsive look on mobile and not navigating or informative at all as it is. 
      I searched for solutions online and tries some of those that I found but nothing worked out. Also I found a previous post on this forum says that this theme pagelines DMS is not meant to be build to deactivate the responsive function... 
      Also tried with widget such as WPtouch to edit the mobile look a little more informative but as I am using "single page" theme on pagelines, the frontpage(main page) never appears on those app.
      Seems like not compatible?
      If there is no way to deactivate responsive function or I'll have to recreate another page just dedicated for a mobile page? or change the theme completely and build a page from scratch?
      I have been searching for this for two days already...
      Could anyone wise and kind out there, please help me?
       
      Thanks,
×