i’m taking a post in this way inside an ajax request:
$object_single_post = get_post($post_id); $content = $object_single_post->post_content;
after this task the content of the $content variable is the post with no paragraphs, example:
\r\nFirst paragraph\r\n\r\nSecond paragraph
This post content when displayed in a post automatically becomes:
<p>First paragraph</p> <p>Second paragraph</p>
I’m trying to understand which wordpress function convert the content of the database ( EX.1 ) to the final post ( EX.2 )
I can convert \r\n to
<br />but i don’t like very much this solution and i want the same conversion that wordpress does.
- The topic ‘Get a post content with proper html tags’ is closed to new replies.