Forums
Home / Themes and Templates / How to keep line breaks/paragraphs in image description?
(@dannyfoo)
13 years, 10 months ago
I’m using this code from Dameian to pull the image attachments out.
However, I’ve not been able to find a guide on how to keep line breaks in the image description when we upload it.
Please do share a solution, if you know of one. Thanks.
(@alchymyth)
i assume that you simply echo the
$img_description = $image->post_content; // description.
try to apply a filter:
$img_description = $image->post_content; // description. echo apply_filters('the_content',$img_description);
that would wrap the string into paragraph tags and add html line breaks.