Advertisement
alchymyth

comments callback function for child of TwentyTen

Mar 16th, 2012
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.79 KB | None | 0 0
  1. /**
  2.  * Template for comments and pingbacks - modified for the child theme
  3.  *
  4.  * Used as a callback by wp_list_comments() for displaying the comments.
  5.  *
  6.  * @since Twenty Ten 1.0
  7.  */
  8. function twentyten_comment( $comment, $args, $depth ) {
  9.     $GLOBALS['comment'] = $comment;
  10.     switch ( $comment->comment_type ) :
  11.         case '' :
  12.     ?>
  13.     <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
  14.         <div id="comment-<?php comment_ID(); ?>">
  15.         <div class="comment-author vcard">
  16.             <?php echo get_avatar( $comment, 40 ); ?>
  17.             <?php printf( __( '%s <span class="says">says:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
  18.         </div><!-- .comment-author .vcard -->
  19.         <?php if ( $comment->comment_approved == '0' ) : ?>
  20.             <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
  21.             <br />
  22.         <?php endif; ?>
  23.  
  24.         <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
  25.             <?php
  26.                 /* translators: 1: date, 2: time */
  27.                 printf( __( '%1$s', 'twentyten' ), get_comment_date() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
  28.             ?>
  29.         </div><!-- .comment-meta .commentmetadata -->
  30.  
  31.         <div class="comment-body"><?php comment_text(); ?></div>
  32.  
  33.         <div class="reply">
  34.             <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  35.         </div><!-- .reply -->
  36.     </div><!-- #comment-##  -->
  37.  
  38.     <?php
  39.             break;
  40.         case 'pingback'  :
  41.         case 'trackback' :
  42.     ?>
  43.     <li class="post pingback">
  44.         <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p>
  45.     <?php
  46.             break;
  47.     endswitch;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement