post_content with line breaks
I want to be able to get post_content with line breaks. What is the best way to do it?
I previously use the_content() which was working fine until I needed to install a plugin that adds share buttons on each post.
Since then the output of my the_content includes texts from the share buttons.
I tried to use post_contents which contains the correct content I need to output on my template file but the problem is the line breaks were stripped off.
Is it possible to get post_content with line breaks preserved?
Thanks
I believe this should work:
The second argument in wpautop can be up to you whether it’s true of false, see the link below. It is described as follows:
Source:
https://developer.wordpress.org/reference/functions/wpautop/