Skip to content

109 Sandbox

A website made for testing

WordPress filters, the_content() and get_the_content()

Published ·UPD ·In WordPress

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());