Hi @minder88. I’d love to figure out why this occurs to some people. For most this “bug” doesn’t happen. I wonder if it is a conflict with the ob_callback() function and another plugin which is using it (e.g. ob_end_flush mishap).
I’m curious…let’s perform a test. Since i can’t duplicate this problem on my end, can you try disabling all of your plugins (besides w3tc) and see if the minified css is now within the <head>? I just want to eliminate the possibility of a misbehaving plugin and narrow down what could be the cause.
Thanks for the info
Hi @kimberly,
Thanks for your answer!
These were the results:
1) When all plugins were disabled except for W3TC the CSS minify on Home Page was correct, right after the head tag. But before the doctype on posts and pages.
2) I also found that when “All In One Seo Pack Plugin” was enable and all others disabled except for W3TC of course, the CSS was before the doctype on Home Page, Posts and Pages.
3) When W3TC was disabled and all plugins activated, no code were found at all before the doctype declaration.
What do you think about this?
Hi again! Was trying to duplicate the problem on my end using a fresh install of WordPress + w3tc + All in One SEO. Still working just fine (minifies into the <head> just fine). Curious, are you using a free theme? If so what is its name? I want to duplicate as much of your side on mine in hopes of getting the same problem.
Here is what ive done so far:
1. Installed a fresh WordPress 4.5
2. Under Add New Plugins i searched and installed All In One SEO
3. Activated All in One SEO (and didnt touch any of its default settings)
4. Under Add New Plugins i searched and installed W3TC (and applied the known deprecation fixes).
5. Activated W3TC (leaving all its default settings as is)
6. However, under W3TC’s General Settings: i checked on “Minify – Enable” — it is set to “Auto” minify mode.
Page result:
<!DOCTYPE html>
<html lang="en-US" class="no-js">
<head>
<link rel="stylesheet" type="text/css" href="/wp-content/cache/minify/000000/M9AvKU_NK6kszqwoSU3N009PzUstykzOzytGYuoYoKkqLqnMSQUA.css" media="all" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
I find this problem of yours very fascinating.
Well, my assumption now is that it has to do with the theme. I´m using the Agency Pro Genesis Child Theme (Paid) by StudioPress.
For now I have solved the issue by inserting <!– W3TC-include-css –> before the </head> tag using my Theme´s Header and Footer Scripts Section.
By now is perfect. I am going to stop here, I have been too focused these days!
But based on my experimentation it also looks like W3TC has its own criterium for inserting the CSS depending on some plugins
Thank you for all!