The WordPress function get_the_content() doesn’t format the content.
Incorporating this within a piece of code, all of the line spacing added in the editor box was lost. The resulting content was one block of text, paragraphs were lost,
Its difficult to read and doesn’t encourage the visitor to follow the text to the blog post entry.
Usually on a page or post WordPress automatically adds in the wrapping for paragraphs when it renders text entered via the text editor.
But using get_the_content() this additional formatting was missing.
Is there an alternative function which is to be used or do I create my own?
I considered adding my own function to add the missing formatting. But then realised that I could use the WordPress function the_content() which does add in the paragraph tags.
Well I found that using the_content() had solved my issue.
The WordPress developer site confirms that the function the_content() does not pass the derived content through the the_content() filter. Thus when using this function directly it omits embedded videos and shortcodes will not be expanded.
References
https://developer.wordpress.org/reference/functions/get_the_content/


