Community Forums › Forums › Archived Forums › General Discussion › Changes to comment_form via filter
Tagged: add_filter comment_form
- This topic has 6 replies, 2 voices, and was last updated 12 years, 1 month ago by
Tony @ AlphaBlossom.
-
AuthorPosts
-
September 7, 2014 at 9:19 am #123151September 7, 2014 at 1:14 pm #123183
Tony @ AlphaBlossom
MemberHello,
You can do this with the default WordPress filter, adding this code to your theme's functions.php file:
add_filter( 'comment_form_defaults', 'youruniqueprefix_change_comment_label' ); function youruniqueprefix_change_comment_label( $args ) { $args['comment_field'] = '<p class="comment-form-comment"><label for="comment">' . _x( 'Note', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>'; return $args; }Have a great day.
Tony
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
September 7, 2014 at 1:34 pm #123189Edward
MemberThanks, Tony! Much appreciated. Have a great day.
September 7, 2014 at 3:14 pm #123210Edward
MemberTony, one last question. How do I remove the website input box?
This is what I added:
$args['fields'] = array(
'url' => ''
);But, then all my input boxes above the comment box disappeared.
Then, I copied the additional fields from lib\structure\comments.php ( $commenter, $req, $aria_req, $author, $email ) and set $url to blank but the text labels appear messed up underneath the input box. I just started learning this so I'm confused on how to accomplish this.
Thanks, mate!
September 7, 2014 at 4:05 pm #123218Tony @ AlphaBlossom
MemberUse this to remove the URL field:
/* * Remove URL field * */ add_filter( 'comment_form_default_fields', 'youruniqueprefix_remove_comments_form_url_field' ); function youruniqueprefix_remove_comments_form_url_field( $fields ) { if( isset( $fields['url'] ) ) unset( $fields['url'] ); return $fields; }
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
September 8, 2014 at 9:33 am #123390Edward
MemberTony, thanks you are awesome! What sites/resources would you recommend for learning WordPress/Genesis development? Also, do you offer coaching/tutoring services? We'll definitely be contacting your company for Genesis work.
September 10, 2014 at 10:44 pm #123862Tony @ AlphaBlossom
MemberHi Edward,
Glad I could help!
As far as resources, there's a lot of good ones...here's some:
http://sridharkatakam.com/
http://www.bourncreative.com/
http://www.web-savvy-marketing.com/
http://www.carriedils.com/
http://bradpotter.com/
https://www.facebook.com/groups/genesiswp/And of course our website 🙂 I recommend following all of these people on twitter...there's a lot more talented people in the Genesis community, but these are a great start.
I'm sorry I don't offer coaching...working on a training program but it's a ways out still.
Thanks for the nice compliment...and I'm happy to help in the future in any way I can.
Take care,
Tony
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.