in my wordpress site, the_content() is not showing the content, but $post->post_content shows it, why this is happening? and how can I use the_content again?
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 12 years ago.in my wordpress site, the_content() is not showing the content, but $post->post_content shows it, why this is happening? and how can I use the_content again?
In order to use "the_content()" it must be used within The Loop.
See here: http://codex.wordpress/Function_Reference/the_content
"Displays the contents of the current post. This tag must be within The_Loop."
If it worked before, it's probably a plugin hooking into the_content filter. Disable your plugins one by one to see if this fixes the issue. Next, check the callback functions for the_content
filter.
You can see every callback for the_content by adding the following:
add_action('template_redirect', 'wpse_44152_template_redirect');
function wpse_44152_template_redirect(){
global $wp_filter;
print_r($wp_filter['the_content']);
}
Find each of the functions listed by doing a 'find in files' code search on your code editor. A filter callback HAS TO return $content data back for the_content() to work properly.
you can check your functions.php in your theme folder,find if some function do something for the "the_content" function.my theme have the same problem,and I found a function has a mistake and cause "the_content" can't work
find text like "the_content" in your functions.php,