function amativeness_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; switch ($comment->comment_type) { case 'pingback': case 'trackback': // Display trackbacks differently than normal comments. ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?> "> <p><?php _e('Pingback:', 'amativeness'); ?> <?php comment_author_link(); ?> <?php edit_comment_link(__('(Edit)', 'amativeness'), '<span class="edit-link">', '</span>'); ?> </p> <?php break; default: // Proceed with normal comments. global $post; ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?> "> <article id="comment-<?php comment_ID(); ?> " class="comment-b"> <header class="comment-meta comment-author vcard"> <?php echo get_avatar($comment, 44); printf('<div class="comments-authore-title"><div class="comments-name">%1$s %2$s</div>', get_comment_author_link(), $comment->user_id === $post->post_author ? '<span class="comment-master">' . __('一只萌萌哒博主', 'amativeness') . '</span>' : ''); get_author_class($comment->comment_author_email, $comment->user_id); echo '<div class="comments-ua">'; if (function_exists(useragent_output_custom) === true) { useragent_output_custom(); } echo '</div></div>'; printf('<a href="%1$s"><time datetime="%2$s">%3$s</time></a>', esc_url(get_comment_link($comment->comment_ID)), get_comment_time('c'), sprintf(__('%1$s %2$s', 'amativeness'), get_comment_date(), get_comment_time())); ?> </header> <!-- .comment-meta --> <?php if ('0' == $comment->comment_approved) { ?> <p class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.', 'amativeness'); ?> </p> <?php } ?> <section class="comment-content comment"> <?php comment_text(); ?> <?php edit_comment_link(__('Edit', 'amativeness'), '<p class="edit-link">', '</p>'); ?> <div class="comment-reply""> <?php comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'amativeness'), 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div> <!-- .reply --> </section> <!-- .comment-content --> </article> <!-- #comment-## --> <?php break; } // end comment_type check }
function mytheme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?> "> <div id="comment-<?php comment_ID(); ?> "> <div class="comment-author vcard"> <?php echo get_avatar($comment, $size = '40', $default = '<path_to_url>'); ?> <cite class="fn"><?php comment_author_link(); ?> </cite> <span class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars(get_comment_link($comment->comment_ID)); ?> "><?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()); ?> </a><?php edit_comment_link(__('(Edit)'), ' ', ''); ?> </span> <span class="useragent_output_custom"><?php if (function_exists('useragent_output_custom')) { useragent_output_custom(); } ?> </span> </div> <?php if ($comment->comment_approved == '0') { ?> <em class="approved"><?php _e('Your comment is awaiting moderation.'); ?> </em> <br /> <?php } ?> <div class="comment-text"> <p class="useragent_output_custom"><?php if (function_exists('useragent_output_custom')) { useragent_output_custom(); } ?> </p> <?php comment_text(); ?> </div> <div class="reply"> <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div> </div> <?php }