Created
October 16, 2012 15:49
-
-
Save markwearing/3900100 to your computer and use it in GitHub Desktop.
Template for comments and pingbacks.
This file contains hidden or 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( 'oneltd_comment' ) ) : | |
| /** | |
| * Template for comments and pingbacks. | |
| * | |
| * Used as a callback by wp_list_comments() for displaying the comments. | |
| * | |
| * @since oneltd 1.0 | |
| */ | |
| function oneltd_comment( $comment, $args, $depth ) { | |
| $GLOBALS['comment'] = $comment; | |
| switch ( $comment->comment_type ) : | |
| case 'pingback' : | |
| case 'trackback' : | |
| ?> | |
| <li class="post pingback"> | |
| <p><?php _e( 'Pingback:', 'oneltd' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'oneltd' ), ' ' ); ?></p> | |
| <?php | |
| break; | |
| default : | |
| ?> | |
| <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> | |
| <article id="comment-<?php comment_ID(); ?>" class="comment"> | |
| <footer> | |
| <div class="comment-author vcard"> | |
| <?php echo get_avatar( $comment, 40 ); ?> | |
| <?php printf( __( '%s <span class="says">says:</span>', 'oneltd' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?> | |
| </div><!-- .comment-author .vcard --> | |
| <?php if ( $comment->comment_approved == '0' ) : ?> | |
| <em><?php _e( 'Your comment is awaiting moderation.', 'oneltd' ); ?></em> | |
| <br /> | |
| <?php endif; ?> | |
| <div class="comment-meta commentmetadata"> | |
| <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><time pubdate datetime="<?php comment_time( 'c' ); ?>"> | |
| <?php | |
| /* translators: 1: date, 2: time */ | |
| printf( __( '%1$s at %2$s', 'oneltd' ), get_comment_date(), get_comment_time() ); ?> | |
| </time></a> | |
| <?php edit_comment_link( __( '(Edit)', 'oneltd' ), ' ' ); | |
| ?> | |
| </div><!-- .comment-meta .commentmetadata --> | |
| </footer> | |
| <div class="comment-content"><?php comment_text(); ?></div> | |
| <div class="reply"> | |
| <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> | |
| </div><!-- .reply --> | |
| </article><!-- #comment-## --> | |
| <?php | |
| break; | |
| endswitch; | |
| } | |
| endif; // ends check for oneltd_comment() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment