ThemeShaper Forums » Thematic


Display recent comments with gravatar and excerpts?

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


  1. adred

    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'); ?>
    <?php foreach ($comments as $comment) { ?>
            $title = get_the_title($comment->post_ID);
            echo get_avatar( $comment, '42' );
            echo strip_tags($comment->comment_author);
            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>
    <?php }  ?>

    Could it be caused by a conflict with Thematic?

    Posted 8 years ago #
  2. adred

    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.