Last active
October 4, 2015 13:39
-
-
Save calliaweb/a0d67c2b49d4c1d7a7a8 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_only' ); | |
/** | |
* Show date on comments without time or link | |
* | |
* Stop the output of the Genesis core comment dates and outputs comments with date 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_only( $comment_date ) { | |
printf('<p %s><time %s>%s</time></p>', | |
genesis_attr( 'comment-meta' ), | |
genesis_attr( 'comment-time' ), | |
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