Created
July 8, 2014 08:52
-
-
Save hellofromtonya/bc8b74f2d791d5ea4f19 to your computer and use it in GitHub Desktop.
Add Comment Count to Comment Title & Modify Comment Form Defaults
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
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