Take the 2-minute tour ×

I am using get_comments() to retrieve the comments of a specific wordpress post in my custom theme. The problem is that there is no HTML inside of the output.

for example when a user adds an URL to a comment, in the admin console it shows as a link but using get_comments() it returns just text.

As there are no filters or other options that covers this on this page: http://codex.wordpress.org/Function_Reference/get_comments I don't quite know what is wrong. Am I supposed to manage that with javascript afterwards?

Thanks for your help guys!

share|improve this question

2 Answers 2

I'd guess you could apply the 'the_content' filter;

<?php foreach (get_comments() as $comment): ?>
    <div class="comment">
        <?=apply_filters('the_content', $comment->comment_content) ?>
<?php endforeach; ?>
share|improve this answer
It does add <p>'s but no links. :-/. Good idea though! –  SnippetSpace Sep 19 '12 at 12:15

I'd recommend taking a look at an existing theme's comments.php template file, modifying it to suit your purposes, and then calling it via comments_template().

The theme based on ZURB's Foundation Framework, for example uses wp_list_comments:

<ol class="commentlist">
    <?php wp_list_comments(); ?>

See if that gives you a more formatted output.

share|improve this answer

Your Answer


