Title: Most Recent Comments Problem =(
Last modified: August 19, 2016

---

# Most Recent Comments Problem =(

 *  Resolved [luiscolin](https://wordpress.org/support/users/luiscolin/)
 * (@luiscolin)
 * [17 years ago](https://wordpress.org/support/topic/most-recent-comments-problem/)
 * Hello, good night.
 * I’m trying to use this code to show the most recent coments in my blog. It works,
   but the comments appear in 3 lines, like this:
 * “Author”
 * in
 * “Topic”
 * And i want “Author in Topic”
 * You can check here: [http://www.luiscolin.com/](http://www.luiscolin.com/) At
   the bottom.
 * Can you help me?
 * Thanks!
 *     ```
       <?php
       $number=5; // number of recent comments desired
       $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT $number");
       ?>
       <ul id="recentcomments">
       <h2>Recent Comments</h2>
       <?php
       if ( $comments ) : foreach ( (array) $comments as $comment) :
       echo  '<li class="recentcomments">' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_comment_link($comment->comment_ID) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
       endforeach; endif;?></ul>
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * (@stvwlf)
 * [17 years ago](https://wordpress.org/support/topic/most-recent-comments-problem/#post-1082534)
 * Hi your problem is here style.css (line 587)
 *     ```
       #bottom ul li a {
       color:#FFFFFF;
       display:block;
       padding:0 10px;
       text-decoration:none;
       }
       ```
   
 * display needs to be “inline” not “block”
    Its possible changing that may mess
   up other things.
 *  Thread Starter [luiscolin](https://wordpress.org/support/users/luiscolin/)
 * (@luiscolin)
 * [17 years ago](https://wordpress.org/support/topic/most-recent-comments-problem/#post-1082674)
 * Thanks! It worked =)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Most Recent Comments Problem =(’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [luiscolin](https://wordpress.org/support/users/luiscolin/)
 * Last activity: [17 years ago](https://wordpress.org/support/topic/most-recent-comments-problem/#post-1082674)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
