2

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);?>
3

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 May 10 '11 at 21:27
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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