How To Add A Genesis Comment Policy Box to a StudioPress Child Theme

Here’s an intermediate WordPress tutorial that demonstrates the simple steps involved in adding a Genesis comment policy box to your StudioPress child theme.

The code below will add a comment policy statement directly below the text Speak Your Mind, the default text used above the comment form for StudioPress themes. Many people don’t like the label Speak Your Mind and a previous WordPress tutorial titled How to Modify Speak Your Mind shows how easy it is to change the label to something you prefer.

To add a Genesis comment policy box to your theme, copy the code below and place it within your theme’s functions.php file. In order for the code below to work properly, the code should be placed in your child theme’s functions.php file after this code:

require_once( get_template_directory() . '/lib/init.php' );
/** Modify comment form */
add_filter('genesis_comment_form_args', 'minimum_comment_form_args');
function minimum_comment_form_args($args) {
	$args['title_reply'] = 'Leave a Comment';
	$args['comment_notes_before'] = '<p class="comment-policy">' . __( 'Please, only use your <strong>real name</strong>, not your business name or keywords. We moderate all comments before they appear on our website and will delete and <em>mark as spam</em> anyone not using their real name.' ) . ( $req ? $required_text : '' ) . '</p>';
	return $args;
}

The image below demonstrates how the code will place a comment policy within your page.

comment policy box

Take note that the comment policy statement is right below the H3 title in this case “Leave a Comment.’ If you prefer to have the comment policy display under the form, just above the submit button, change Line 5 in the code above to what you see below.

Take note that you are simply changing comment_notes_before to comment_notes_after. Everything else remains the same. The image below details how it looks on screen when changing the location to below the form directly above the submit button.

 $args['comment_notes_after'] 

genesis comment policy box

So there you have it. A cut & paste wp snippet to easily add a Genesis Comment Box to your StudioPress child theme.

Written by Rick R. Duncan

Rick is a Richmond WordPress Developer and cyclist that enjoys pedaling WordPress, SEO and Internet Marketing Tips on Twitter, Google+ and here on WPSyntax.com.

Comments

  1. I actually would like to save this article, “How To Add
    A Genesis Comment Policy Box to a StudioPress Child Theme | WPSyntax”
    on my very own web-site. Do you mind in case I actuallydo it?
    Thanks ,Emma

    • Hi Maurine, Emma, Kelley or whatever the hell your real name is…

      I think it’s best if you only bookmark the content. My content is copyrighted by B3Marketing, LLC. If you copy my content onto your website I would be forced to report you to http://www.dmca.com and would also submit a spam report to Google. Again, I’m flattered that you want to have a copy of it, but please simply bookmark my page and don’t copy it.

      -rd

  2. Hola! I’ve been reading your web site for some time now and finally got the bravery to go ahead and give you a shout out from Kingwood Texas! Just wanted to tell you keep up the great work!

  3. If i edit my child theme functions with this, i get a 500 server error. Any recommendations?

    Thanks,
    Byron

    • Rick R. Duncan says:

      Hey Byron,

      If you’re getting a 500 error then chances are you mis-typed something in the code above. Confirm that nothing but source code was copied from my website and placed into your theme’s function.php file.

      -rd

Leave a Comment

Please, only use your real name, not your business name or keywords. We moderate all comments before they appear on our website and will delete and mark as spam anyone not using their real name.

*