WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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);?>
share|improve this question
up vote 3 down vote accepted

applying the 'the_content' filter could work:

<?php echo apply_filters('the_content', $comment->comment_content); ?>
share|improve this answer
    
Working! Thanks Michael! – Andycap May 10 '11 at 21:24
    
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

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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