WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Following this solution to create dynamic css instead of inline css from sorich87 I get an error when requesting the dynamically generated stylesheet. Css is in there but also the default wp error page and a 404 header returned.

Solution I used: http://wordpress.stackexchange.com/a/1454

My stylesheet url with 404 error: http://tegelzetbedrijf.net/wp-content/plugins/wp-google-fonts/googlefonts.css?build=20120126

Any suggestions are highly appreciated! Thanks Quokka

share|improve this question
I'm not sure I understand what the error is...it looks like you're outputing text though, not CSS. – mor7ifer Feb 19 '12 at 15:40
Hi, I'm outputting css, with header("Content-type: text/css"); But a 404 error is triggered, I understand why, because the file is not physically available. But if anyone knows how to prevent this, that would be awesome! Thanks! – quokka Feb 19 '12 at 15:47
View source, you have a lot of HTML in there, CSS files need to be pure CSS. It looks like wordpress is trying to load it as a template or something of that nature. – mor7ifer Feb 19 '12 at 15:58
Yes I know that, wp is serving the defaul 404 page. With my css in it. I would like to know how to prevent that and avoid the 404 error from happening. Thanks – quokka Feb 19 '12 at 17:23
up vote 0 down vote accepted

The solution you're using to get the stylesheets onto the page is a terrible method. Wordpress provides the enqueue functions specifically to do what you're trying to do. The codex page on wp_enqueue_style() explains exactly what you need to do. If you would like to add a dynamic version, there is a parameter for that.

share|improve this answer
Thanks a lot, i'll digg into that!! For the meantime if just added the css in my stylesheet manually :) – quokka Feb 19 '12 at 22:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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