• I am cleaning up my comments page and want to display comments as follows:
    author: comment text….
    I am using this:
    <?php comment_author() ?>: <?php comment_text() ?>
    but it puts a line break in between the author and the text, is there a workaround, or am I doing something wrong?
    New to WP, already an addict. Thanks to all the devs who worked so hard to make such a great product. Great community here, glad to be a part of it.
    -Lucid

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Lucid

    (@lucid)

    Makes sense, gonna try and implement this change tonight.
    Many thanks…I have learned so much on these forums, hope I can help those is need learn as much as I have been.
    -Lucid

    This is exactly the problem I have but all I can see are Lucid’s two posts and not the response to the problem. Can anyone post the solution again please?

    The “line break” is due to the comment text being put into paragraph tags. They are added by the default WordPress filters. When this is entered by the commenter:

    Hello, this is a comment.

    Cool site!

    This is what’s outputted:

    Hello, this is a comment.

    Cool site!

    This is so that two <br />‘s aren’t used and so that one can control the spacing between paragraphs.

    Probably the easiest way to get around it would be to directly use the data from the database:

    <?php echo $comment->comment_content; ?>

    However, you’d need to sanatize the data and such for output (replace certain characters with HTML entities, replace line breaks with <br />‘s, etc.)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘comment_author() line break?’ is closed to new replies.