Advertisement
alchymyth

Untitled

Mar 31st, 2011
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.00 KB | None | 0 0
  1. <div class="fcontent12">
  2.                 <?php
  3.                     global $comment;
  4.                     if ( $comments = $wpdb->get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID FROM $wpdb->comments WHERE comment_approved='1' ORDER BY comment_date_gmt DESC LIMIT 5") ) :
  5.                   ?>
  6.                 <ul>
  7.                   <li><h2>Recent Comments</h2>
  8.                     <ul>
  9.                       <?php
  10.                         foreach ($comments as $comment) {
  11.                           echo '<li>' . sprintf('%s <span style="text-transform: lowercase;"> on - </span>%s', get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . get_the_title($comment->comment_post_ID) . '</a>');
  12.                           echo '</li>';
  13.                         }
  14.                       ?>
  15.                     </ul>
  16.                   </li>
  17.                 </ul>
  18.                   <?php endif; ?>
  19.         </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement