get_the_content() not formatting when output

Using get_the_content() instead of the_content() function in your theme, to modify the content before displaying it on the website but the output is different when using the_content(). WordPress get_the_content() does not run its formatting functions.

To fix this add the following snippet into your themes directory, this snippet of code applies the filters that are run when the_content() is called, thus formatting the output.

To use this in your theme, instead of calling get_the_content(), call jc_get_the_content() instead.

function jc_get_the_content($more_link_text = null, $stripteaser = false){
	$content = get_the_content( $more_link_text, $stripteaser);
	$content = apply_filters( 'the_content', $content );
	return $content;

Liked this article? help spread the word.