Bump.
Does no one have an answer to this. I imagine it should be easily solved by someone better at WordPress coding than me?
I have the same issue noted above. There is something about this line:
<?php comment_text() ?>
It encloses each comment line in paragraph tags but it doesn’t add the so everything looks scrunched up.
I have tried str_replace to fix this, but it remains unaffected:
<?php echo str_replace("</p>","</p><br />", comment_text()); ?>
I am all out ideas and I am not sure how to fix this either. I have tried other themes and they include the line breaks.
I hope this helps explain what the issue is.
try
<?php echo get_comment_text(); // no default filters ?>
Hello,
I tried
<?php echo get_comment_text(); // no default filters ?>
and it removed all of the paragraph tags, removing all remaining linebreaks, making everything look like a giant paragraph no matter how many times the user added a line break for the comments.
However, I modified your above line of code, which did change all newline characters to tags, which did fix my problem:
<?php echo str_replace("\n","<br />",get_comment_text()); ?>
So, basically it got rid of the paragraph tags but it replaces the newlines "\n"
with <br />
, which has the same output. It still has the same problem if I change get_comment_text()
to comment_text()
. The only downside to get_comment_text()
is that it doesn’t convert web urls in comments to clickable hyperlinks, but this is not an issue for me. I don’t know if it truly follows proper HTML-etiquette, but it’s a nice quickfix for now.
What about wrapping <?php comment_text() ?> in its own class?
i.e. class=”comment_text”
I’m sorry. I don’t know anything about wrapping classes. How would it be done for comment_text?
(@bhakans)
15 years, 8 months ago
I have a problem with a template called “Wedding rose” – when you submit comments to it no html seems to get included. If you view the source for the page the comment is formatted with every hard line break/paragraph intact, but as there are no HTML tags everything will be displayed as one block of text.
I know the problem has to be with the template, comments are formatted just fine if I switch to the default template (new comments that is, comments submitted through the wedding rose template are still one block of text).
Does this mean the error is in the CSS or in Comments.php?
This is the comments section of the CSS:
And this is Comments.php: