Skip to content

Instantly share code, notes, and snippets.

@rfmeier
Created December 28, 2014 16:12
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 rfmeier/aeb327a23dc22d3f4aad to your computer and use it in GitHub Desktop.
Save rfmeier/aeb327a23dc22d3f4aad to your computer and use it in GitHub Desktop.
Display comment bubbles for all post meta.
<?php //* do not include <?php
/**
* Note: original code snippet from Slick WP
* http://slickwp.com/genesis-comment-bubble/
*/
add_filter( 'genesis_post_info', 'sp_post_info_filter' );
/**
* Callback for Genesis 'genesis_post_info' filter.
*
* Add a styling wrapper around comment count.
* Originally from http://slickwp.com/genesis-comment-bubble/
*
* In response to Studiopress support forums;
* http://www.studiopress.com/forums/topic/shortcode-for-comment-bubble/
*
* @author Ryan Meier <http://www.rfmeier.net/>
*
* @param string $post_info The post info string.
* @return string $post_info The post info string.
*/
function sp_post_info_filter( $post_info ) {
$num_comments = get_comments_number();
$comments_link = get_comments_link();
$bubble = "<span class='bubble'><a href='".$comments_link."'>".$num_comments."</a></span>";
$post_info = 'By [post_author_posts_link] on [post_date] '.$bubble.'';
return $post_info;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment