-
-
Save rfmeier/aeb327a23dc22d3f4aad to your computer and use it in GitHub Desktop.
Display comment bubbles for all post meta.
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
<?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