简体   繁体   中英

W3 Total Cache and body_class

I just installed the W3 Total Cache Wordpress plugin on a client site and, at first glance, everything seems to be working great. The issue is when I view a single post, the comment W3 Total Cache plugin adds at the bottom of the page seems is commenting out the <body> element and returning this:

<body 
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached (User is logged in)
Object Caching 959/1096 objects using memcached

Served from: mydomain.com @ 2014-06-03 12:23:05 by W3 Total Cache -->

When I remove the <?php body_class(); ?> <?php body_class(); ?> function from the header the page loads, but without the sidebar and other elements.

I've enabled the WP_DEBUG in wp-config.php and that points me to a foreach loop error in /wp-includes/plugin.php on line 622 which refers to the plugin_basename($file) function. I'm assuming something is conflicting with W3 Total Cache and throwing off the plugin basename. My guess is Wordpress is searching for a plugin that can't be found?

This is the only plugin I've recently enabled, and the issue is not fixed when I disable it. Has anyone experienced this before or does anyone have any idea what I can do to get my individual posts back?

EDIT: When W3 Total Cache is deactivated the <body> element renders like <body with no closing > , therefore not rendering anything beyond that.

EDIT 2: I have reverted back to Wordpress 3.8 which seems to have fixed the issue. I am hoping to get a fix in for 3.9 soon.

It looks to me like the issue is that the <body> tag is missing the final >

Are you sure this is related to W3 Total Cache? If I've read your post correctly it seems that even if you remove this plugin then you still get this issue?

Maybe you have accidentally deleted a > after the body tag in the header.php?

It is easily done if there are multiple <?php classes after the <body part of the tag.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM