Last active
October 10, 2015 17:50
-
-
Save calliaweb/5eb557f30e9b00fff748 to your computer and use it in GitHub Desktop.
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 | |
add_filter( 'genesis_show_comment_date', 'jmw_show_comment_date_with_link' ); | |
/** | |
* Show Comment Date with link but without the time | |
* | |
* Stop the output of the Genesis core comment dates and outputs comments with date and link only. | |
* The genesis_show_comment_date filter was introduced in Genesis 2.2 (will not work with older versions) | |
* | |
* @author Jo Waltham | |
* @link http://www.jowaltham.com/customising-comment-date-genesis/ | |
* | |
* @param boolean $comment_date Whether to print the comment date or not | |
* @return boolean Whether to print the comment date or not | |
*/ | |
function jmw_show_comment_date_with_link( $comment_date ) { | |
printf('<p %s><time %s><a href="%s" %s>%s</a></time></p>', | |
genesis_attr( 'comment-meta' ), | |
genesis_attr( 'comment-time' ), | |
esc_url( get_comment_link( get_comment_ID() ) ), | |
genesis_attr( 'comment-time-link' ), | |
esc_html( get_comment_date() ) | |
); | |
// Return false so that the parent function doesn't output the comment date, time and link | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment