Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Customize the text before the comment form in WordPress. Note: Logged in users will not see this text.
<?php //remove this line
add_filter( 'comment_form_defaults', 'cd_pre_comment_text' );
/**
* Change the text output that appears before the comment form
* Note: Logged in user will not see this text.
*
* @author Carrie Dils <http://www.carriedils.com>
* @uses comment_notes_before <http://codex.wordpress.org/Function_Reference/comment_form>
*
*/
function cd_pre_comment_text( $arg ) {
$arg['comment_notes_before'] = "Want to see your ugly mug by your comment? Get a free custom avatar at <a href='http://www.gravatar.com' target='_blank' >Gravatar</a>.";
return $arg;
}
@skgit888

This comment has been minimized.

Copy link

@skgit888 skgit888 commented Jun 16, 2016

Thank you Carrie for posting this code! I wanted to change the comment_notes_before and your code was easiest to understand. Thanks again!

@elllensmith15

This comment has been minimized.

Copy link

@elllensmith15 elllensmith15 commented Dec 12, 2016

I would like to thank the author for sharing this source code. Your post helps me to Customize the text before the comment form in WordPress. I think this post will be a reference to all developers. Expecting more source codes like this.
Spanish with ease

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment