WordPress filters, the_content() and get_the_content()

An important difference between the functions the_content() and get_the_content() in WordPress is the filter named the_content. The first function applies it. The second does not.

To have get_the_content() return the same markup that is echoed by the_content(), apply the the_content filter.

For example:

echo apply_filters('the_content', get_the_content());

Leave a Comment

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