1

I'm trying to disable the Yoast SEO plugin from a very simple site with a custom theme. After disabling the plugin, posts do not have any content -- titles work, just the_content is empty. Pages are fine. If I re-enable the plugin, the post content comes back. The problem does not appear if I switch to one of the default Twenty* themes.

It seems like something is messing up the $post data early on, logging from the the_content filter at all priorities yields an empty string. Error logs are empty. My guess is something calls a Yoast function or filter somewhere, but I haven't found anything yet.

WordPress is a clean v4.7.5, Yoast SEO is v4.8 (both latest versions, fresh installs). The only other active plugin is Advanced Custom Fields Pro. I'm able to recreate this on multiple servers.

2

Turns out the single-post.php template was missing a call to the_post(). Since that function initializes all the postdata used by functions like the_content(), WordPress had nothing to display.

As for Yoast SEO, I'm guessing it calls the_post() somewhere early on which would populate the WordPress global variables. If the theme was written with Yoast SEO enabled, no one would ever have noticed the omission.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.