• I am using the get_comments function to display all recent comments.
    Like this:

    <?php foreach (get_comments() as $comment): ?>
    <div><?php echo $comment->comment_author; ?> said: "<?php echo $comment->comment_content; ?>".</div>
    <?php endforeach; ?>

    But the deviantart image doesn’t appear.
    How do I get it to appear?

    Thank you!

    http://wordpress.org/plugins/deviantart-muro/

Viewing 1 replies (of 1 total)
  • Thread Starter Hannes17

    (@hannes17)

    Okay, here is the solution:

    The image is added during the get_comment_text hook, accessing $comment->comment_content directly will bypass that hook (and break any other plugins that rely on the hook too).

    You’ve got two easy options though, either use get_comment_text($comment_ID) or run the hook manually yourself by changing your code to <?php echo apply_filters(‘get_comment_text’, $comment->comment_content, $comment); ?>.

Viewing 1 replies (of 1 total)
  • The topic ‘Get recent comments’ is closed to new replies.