Archived

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

  • 0

Simplifying the comment form


Question

Posted · Report post

I’d like to simplify the Comment Form Title as follows…

 

From the default ‘One Response to Post Name’ or ‘3 Responses to Post Name

 

To ‘1 Comment’ or ‘3 Comments’

 

I’d also like to add a line of text underneath where it says ‘Leave a Reply’ but before the comment fields.

 

 

Can this be done so that it is not overwritten when I update WordPress or Paglines?


Many thanks in advance!



 



 

Share this post


Link to post
Share on other sites

12 answers to this question

Posted · Report post

The following code should do the job, simply add it to your child themes/customisation plugins functions.php file:

 

    add_filter('comment_form_defaults','comment_reform');
        function comment_reform ($arg) {
        $arg['title_reply'] = __('Add Your Change Here');
        return $arg;
    }


Replace the "Add Your Change Here" to what you want to change it to.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks but that looks like the code I've already added to change the reply title - its the Comment title above that I don't know how to change...

 

The bit where it says...

 

‘One Response to Post Name

Share this post


Link to post
Share on other sites

Posted · Report post

simondesign For that you need to actually edit a file im afraid. To do that safely you need a child theme like the free 'base theme' in the store. Then copy the comments.php from the main framework folder and edit it to your taste. Wordpress will load your child one instead of the parent one automagically.

Share this post


Link to post
Share on other sites

Posted · Report post

ok, many thanks I'll have look at that.

 

I also now want to add a list of the categories and / or tags assigned to a post at the bottom of the post (before the Comment bit) - should I also do that in the child theme do you think?

 

Cheers!

Share this post


Link to post
Share on other sites

Posted · Report post

Just one more quick question I'm afraid - can you clarify ' Then copy the comments.php from the main framework folder and edit it to your taste.' please??

 

Where within the base theme do I copy the comments.php code to exactly?

Share this post


Link to post
Share on other sites

Posted · Report post

Into its folder...

 

wp-content/themes/pagelines/comments.php

 

copy to...

 

wp-content/themes/base-child-theme/comments.php

 

edit away...

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks v much that's sorted the Comments title :)

 

I also now want to add a list of the categories and / or tags assigned to a post at the bottom of the post (before the Comment bit) - should I
also do that in the child theme do you think?

Share this post


Link to post
Share on other sites

Posted · Report post

Yes.

 

Another hook would yield that result, I believe.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

 

Renaming the ‘One Response to Post Name’ or ‘3 Responses to Post Name’ may be possible and will require a filter.

 

If you wish to insert content below the leave reply, I recommend you install the ActionMap plugin from the PageLines store and then follow the instructions here.

 

http://support.pagelines.me/docs/plugins/action-map/

 

Once you have the correct hook location, you will need to create a hook to insert your content.

Share this post


Link to post
Share on other sites

Posted · Report post

Thank you I'll have look at another hook for that then.

 

Cheers :)

Share this post


Link to post
Share on other sites

Posted · Report post

Do you need further assistance with this issue?

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks, I've used hooks before - not used the ActionMap plugin before though so thanks for that.

 

It's shown up pagelines_before_comments, pagelines_inside_bottom_comments and pagelines_after_comments.

 

I found the link below and have successfully changed the 'Leave a reply' text using the code from the link below by adding it to the pagelines-customize/functions.php

 

But I'm struggling with how to change the Comment Form Title - as described previously - any help much appreciated! :)

 

http://www.pagelines.com/forum/topic/24658-changing-text-of-post-comment-button/

Share this post


Link to post
Share on other sites