Skip to content

Instantly share code, notes, and snippets.

@calliaweb
Last active October 10, 2015 17:50
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 calliaweb/5eb557f30e9b00fff748 to your computer and use it in GitHub Desktop.
Save calliaweb/5eb557f30e9b00fff748 to your computer and use it in GitHub Desktop.
<?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