I'm displaying a comment outside the comment template, getting it with get_comments() and echoing the comment_content. My problem is that the comment loses the formatting (paragraphs, line breaks, etc...). In my template I'm using TinyMCEComments (TinyMCE on comment form).

Someone pointed me to this solution, but is not working for me.

<?php echo wpautop($comment->comment_content);?>

2 Answers 2


applying the 'the_content' filter could work:

<?php echo apply_filters('the_content', $comment->comment_content); ?>
  • I wasn't looking for the_content in codex, I was looking into get_comments...thanks for the tip, I'm putting it in my deck!
    – Andycap
    Commented May 10, 2011 at 21:27

Try $GLOBALS['comment'] = $comment above that function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.