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.
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.
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.
This topic has been closed to new replies.