Created
February 12, 2016 17:20
-
-
Save generatepress/21b8e4b706caf59470b7 to your computer and use it in GitHub Desktop.
Remove link from the date in comments
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
if ( ! function_exists( 'generate_comment' ) ) : | |
/** | |
* Template for comments and pingbacks. | |
* | |
* Used as a callback by wp_list_comments() for displaying the comments. | |
*/ | |
function generate_comment( $comment, $args, $depth ) { | |
$GLOBALS['comment'] = $comment; | |
$args['avatar_size'] = apply_filters( 'generate_comment_avatar_size', 50 ); | |
if ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) : ?> | |
<li id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>> | |
<div class="comment-body"> | |
<?php _e( 'Pingback:', 'generate' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( 'Edit', 'generate' ), '<span class="edit-link">', '</span>' ); ?> | |
</div> | |
<?php else : ?> | |
<li id="comment-<?php comment_ID(); ?>" <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ); ?>> | |
<article id="div-comment-<?php comment_ID(); ?>" class="comment-body"> | |
<footer class="comment-meta"> | |
<?php if ( 0 != $args['avatar_size'] ) echo get_avatar( $comment, $args['avatar_size'] ); ?> | |
<div class="comment-author-info"> | |
<div class="comment-author vcard"> | |
<?php printf( '<cite class="fn">%s</cite>', get_comment_author_link() ); ?> | |
</div><!-- .comment-author --> | |
<div class="entry-meta comment-metadata"> | |
<time datetime="<?php comment_time( 'c' ); ?>"> | |
<?php printf( _x( '%1$s at %2$s', '1: date, 2: time', 'generate' ), get_comment_date(), get_comment_time() ); ?> | |
</time> | |
<?php edit_comment_link( __( 'Edit', 'generate' ), '<span class="edit-link">| ', '</span>' ); ?> | |
<?php | |
comment_reply_link( array_merge( $args, array( | |
'add_below' => 'div-comment', | |
'depth' => $depth, | |
'max_depth' => $args['max_depth'], | |
'before' => '<span class="reply">| ', | |
'after' => '</span>', | |
) ) ); | |
?> | |
</div><!-- .comment-metadata --> | |
</div><!-- .comment-author-info --> | |
<?php if ( '0' == $comment->comment_approved ) : ?> | |
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'generate' ); ?></p> | |
<?php endif; ?> | |
</footer><!-- .comment-meta --> | |
<div class="comment-content"> | |
<?php comment_text(); ?> | |
</div><!-- .comment-content --> | |
</article><!-- .comment-body --> | |
<?php | |
endif; | |
} | |
endif; // ends check for generate_comment() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment