Learn difference wordpress the_content() and get_the_content() by examples

WordPress the_content() function is almost the same as get_the_content(), it’s defined as:

function the_content( $more_link_text = null, $strip_teaser = false) {
 $content = get_the_content( $more_link_text, $strip_teaser );
 
 /**
 * Filters the post content.
 *
 * @since 0.71
 *
 * @param string $content Content of the current post.
 */
 $content = apply_filters( 'the_content', $content );
 $content = str_replace( ']]>', ']]>', $content );
 echo $content;
}

From code above, the_content() function can not return the post content, however, it add a apply_filters and process “]]>”

Leave a Reply

Your email address will not be published. Required fields are marked *