Title: Copy default WordPress comments code
Last modified: August 19, 2016

---

# Copy default WordPress comments code

 *  [mrtsherman](https://wordpress.org/support/users/mrtsherman/)
 * (@mrtsherman)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/)
 * I am developing a custom theme. I do not currently have a comments.php file, 
   but WordPress appears to be using some sort of default for comments. I really
   like this one, but want to tweak a few things about it.
 * How can I create my own comments.php which is basically a copy of the WordPress
   one?

Viewing 12 replies - 16 through 27 (of 27 total)

[←](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/?output_format=md)
[1](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/?output_format=md)
2

 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/page/2/#post-1982950)
 * It is coming from the output of the `comment_form()` function.
 * Here is a good primer on how this function works:
    [http://ottopress.com/2010/wordpress-3-0-theme-tip-the-comment-form/](http://ottopress.com/2010/wordpress-3-0-theme-tip-the-comment-form/)
 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/page/2/#post-1982964)
 * And once you’ve gotten through that, here’s the more in-depth explanation:
    [http://codex.wordpress.org/Function_Reference/comment_form](http://codex.wordpress.org/Function_Reference/comment_form)
 * And here’s comment_form() in source:
    [http://core.trac.wordpress.org/browser/tags/3.1/wp-includes/comment-template.php#L1509](http://core.trac.wordpress.org/browser/tags/3.1/wp-includes/comment-template.php#L1509)
 * That should give you an idea of what you need to filter to change the text.
 * That text is coming from the ‘comment_notes_before’ key in the $defaults array,
   which you can filter.
 * Here’s the default:
 *     ```
       'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>'
       ```
   
 * You can change this, by adding an arguments array to pass to the call to comment_form(),
   for example (note: untested):
 *     ```
       $mytheme_comment_form_args = array(
         'comment_notes_before' => '<p>Change this to whatever you want...</p>
       );
       comment_form( $mytheme_comment_form_args );
       ```
   
 * Note: the $required_text is:
 *     ```
       $required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' );
       ```
   
 * I’ll do some digging to see if that can be modified.
 *  Thread Starter [mrtsherman](https://wordpress.org/support/users/mrtsherman/)
 * (@mrtsherman)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/page/2/#post-1983072)
 * Thanks, I now understand how comment_form works. I’m not sure if I am a big fan
   of this display system verse what the deprecated system. It is difficult to modify
   the form using an argument array if you are not intimately familiar with the 
   form and its html. Although the old system is harder to maintain, I think it 
   is far easier to modify because you can visually see the markup and where things
   are coming from.
 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/page/2/#post-1983080)
 * It does take some getting used to, but ultimately, it is a lot more powerful!
 * If you run into any difficulties modifying to suit your needs, just ask away 
   here.
 *  Thread Starter [mrtsherman](https://wordpress.org/support/users/mrtsherman/)
 * (@mrtsherman)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/page/2/#post-1983154)
 * In regards to wp_list_comments. I want to modify the actual comments display 
   heavily. Not just CSS, but content. From my installation I can see that this 
   function interacts with `comment-template.php` from wp-includes directory. Is
   modifying this also a no-no? If so, what is the proper way to modify the display
   of posted comments?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/page/2/#post-1983155)
 * Create a custom callback for wp_list_comments:
    [http://codex.wordpress.org/Function_Reference/wp_list_comments](http://codex.wordpress.org/Function_Reference/wp_list_comments)
 *  Thread Starter [mrtsherman](https://wordpress.org/support/users/mrtsherman/)
 * (@mrtsherman)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/page/2/#post-1983156)
 * Thank-you esmi
 *  Thread Starter [mrtsherman](https://wordpress.org/support/users/mrtsherman/)
 * (@mrtsherman)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/page/2/#post-1983161)
 * For comment_reply_link -> How do I change the actual link. For example instead
   of having the default which is:
 * `<a class="comment-reply-link" href="/hello-world/?replytocom=1#respond" onclick
   ="return addComment.moveForm(\"div-comment-1\", \"1\", \"respond\", \"1\")">Reply
   </a>`
 * I want to add
    - Additional Class
    - Wrap ‘Reply’ with span tags
 *  Thread Starter [mrtsherman](https://wordpress.org/support/users/mrtsherman/)
 * (@mrtsherman)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/page/2/#post-1983162)
 * Solved adding the span tags. Just used reply_text param for comment_reply_link.
   Totally stuck on the additional class thing though.
 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/page/2/#post-1983163)
 * What are you trying to accomplish (i.e. with the style) by adding an additional
   class?
 *  Thread Starter [mrtsherman](https://wordpress.org/support/users/mrtsherman/)
 * (@mrtsherman)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/page/2/#post-1983164)
 * I have an existing class which styles links as buttons. This is pulled in from
   an external stylesheet. I know alternatives are to add the reply button class
   to the third party stylesheet (have to ask them) or to copy the styles over into
   the wordpress installation, but I would prefer to keep special cases to a minimum.
 *  Thread Starter [mrtsherman](https://wordpress.org/support/users/mrtsherman/)
 * (@mrtsherman)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/page/2/#post-1983165)
 * Could I use apply_filter? If so, what tag do I use to hook into the reply-to 
   link?

Viewing 12 replies - 16 through 27 (of 27 total)

[←](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/?output_format=md)
[1](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/?output_format=md)
2

The topic ‘Copy default WordPress comments code’ is closed to new replies.

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)

 * 27 replies
 * 3 participants
 * Last reply from: [mrtsherman](https://wordpress.org/support/users/mrtsherman/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/copy-default-wordpress-comments-code/page/2/#post-1983165)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
