Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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. –  m0r7if3r 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. –  m0r7if3r 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

1 Answer 1

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

 
discard

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.