Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Created July 8, 2014 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellofromtonya/bc8b74f2d791d5ea4f19 to your computer and use it in GitHub Desktop.
Save hellofromtonya/bc8b74f2d791d5ea4f19 to your computer and use it in GitHub Desktop.
Add Comment Count to Comment Title & Modify Comment Form Defaults
add_filter('genesis_title_comments', 'do_shortcode', 20 );
add_filter('genesis_title_comments', 'lunarwp_add_comment_total_to_comment_title', 10, 1);
/**
* Add the comment count to the title
*
* @since 1.0.0
*
* @param string $title
* @return string Amended comment title
*/
function lunarwp_add_comment_total_to_comment_title($title)
{
return str_replace('<h3>Comments', '<h3>[post_comments]', $title);
}
add_filter('comment_form_defaults', 'lunarwp_modify_comment_form_defaults');
/**
* Modify the Comment Form Defaults
*
* @since 1.0.0
*
* @param array $args
* @return array Amended comment args
*/
function lunarwp_modify_comment_form_defaults($args)
{
$args['title_reply'] = 'Speak Your Mind';
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment