Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 30th, 2012  |  syntax: None  |  size: 0.90 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function woo_tabs_comments( $posts = 5, $size = 35 ) {
  2.         global $wpdb;
  3.  
  4.         $comments = get_comments( array( 'number' => $posts, 'status' => 'approve' ) );
  5.         if ( $comments ) {
  6.                 foreach ( (array) $comments as $comment) {
  7.                 $post = get_post( $comment->comment_post_ID );
  8.                 ?>
  9.                         <li class="recentcomments">
  10.                                 <?php echo get_avatar( $comment, $size ); ?>
  11.                                 <a href="<?php echo get_comment_link($comment->comment_ID); ?>" title="<?php echo wp_filter_nohtml_kses($comment->comment_author); ?> <?php _e( 'on', 'woothemes' ); ?> <?php echo $post->post_title; ?>"><?php echo wp_filter_nohtml_kses($comment->comment_author); ?> - <?php echo get_permalink($comment->comment_post_ID); ?> - <?php echo date( 'Y/m/d', strtotime($comment->comment_date) ); ?> - <?php echo stripslashes( substr( wp_filter_nohtml_kses( $comment->comment_content ), 0, 20 ) ); ?>...</a>
  12.                                 <div class="fix"></div>
  13.                         </li>
  14.                 <?php
  15.                 }
  16.         }
  17. }