Modifying the Genesis 2.0 Comment Box
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Customize The Comment Form | |
* @author Matt Vaden | |
* link http://www.mattsaffiliatejourney.com/ | |
**/ | |
add_filter( 'comment_form_defaults', 'maj_custom_comment_form' ); | |
function maj_custom_comment_form($fields) { | |
$fields['comment_notes_before'] = '<div class="comment-policy-box">' . | |
'<p class="comment-policy">' . | |
'I\'m very glad you have chosen to leave a comment on my humble site. Please keep in mind that all comments are moderated according to my <a href="/comment-policy/" title="Matt\'s Affiliate Journey - Official Commenting Policy">official commenting policy</a>. Please Do NOT use keywords in the name field because they won\'t be linked to anything anyway...just use your real name. Let\'s try to have a personal and meaningful conversation.' . | |
'</p>' . | |
'</div>'; //Adds a customized Comment Policy Notification | |
$fields['title_reply'] = __( 'Share Your Comments & Feedback:', 'customtheme' ); //Changes The Form Headline | |
$fields['label_submit'] = __( 'Share My Comment', 'customtheme' ); //Changes The Submit Button Text | |
$fields['comment_notes_after'] = '<p>' . | |
'<strong>Commenting Note(s):</strong><br />' . | |
'To insert code into comments, <strong>use: [php]code in here...[/php]</strong><br />' . | |
'Some HTML tags allowed: <strong>, <em>, <del>, etc. <strong>(Just don\'t overdo it, please!)</strong>' . | |
'</p>'; //Removes Form Allowed Tags Box | |
return $fields; | |
} | |
// Remove the URL field | |
add_filter('comment_form_default_fields', 'maj_remove_url_field'); | |
function maj_remove_url_field($fields) | |
{ | |
if(isset($fields['url'])) | |
unset($fields['url']); | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment