ThemeShaper Forums » Thematic

[closed]

Display recent comments with gravatar and excerpts?

(2 posts)
  • Started 8 years ago by adred
  • Latest reply from adred
  • This topic is not resolved

Tags:

  1. adred
    Member

    I couldn't seem to find a plugin with both functionality so I created mine(not a plugin) thru the help of my old friend google. My code works but there's a small glitch, the title of the posts are the same for all recent comments.

    $comments = get_comments('status=approve&number=5'); ?>
    <ul>
    <?php foreach ($comments as $comment) { ?>
        <li><?php
            $title = get_the_title($comment->post_ID);
            echo get_avatar( $comment, '42' );
            echo strip_tags($comment->comment_author);
            ?>&nbsp;<?php
            echo wp_html_excerpt( $comment->comment_content, 35 ); ?>
            <a href="<?php echo get_permalink($comment->post_ID); ?>"
               rel="external nofollow" title="<?php echo $title; ?>">
               <?php echo $title; ?> </a>
        </li>
    <?php }  ?>

    Could it be caused by a conflict with Thematic?

    Posted 8 years ago #
  2. adred
    Member

    Nevermind, I have a typo: $comment->post_ID should be $comment->comment_post_ID

    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.