Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Created July 8, 2014 09:21
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/25b84e6a61d55e031490 to your computer and use it in GitHub Desktop.
Save hellofromtonya/25b84e6a61d55e031490 to your computer and use it in GitHub Desktop.
Add Comment Count + Additional Text to Comment Title
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 more="% Comments - <span>Click Here to Share Your Thoughts</span>" one="1 Comment - <span>Click Here to Share Your Thoughts</span>"]', $title);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment