[wp-hackers] wp-config.php, wp-load.php, and ABSPATH

Jörn Röder kontakt at joernroeder.de
Tue Sep 15 08:58:48 UTC 2009


Hi,
I think, you can…

i try this:
- create style.css.php

-embed new styles
- style.css:
	@import url(style.css.php);

- style.css.php:

<?php
require_once("../../../wp-blog-header.php");
header("Content-type: text/css");
?>
@charset '<?php bloginfo('charset') ?>';

#header:after,
.header:after {
	content:'<?php bloginfo('name'); ?>'
}

I don't now if there are any problems with caching, but you can read  
this article on smashingmagazine about php and css. Maybee it will  
help you.
http://www.smashingmagazine.com/2009/09/10/css-wishlist-new-ideas-debates-and-solutions/



Am 15.09.2009 um 08:13 schrieb Andrew Ozz:

> Stephen Rider wrote:
>> Okay then, here's an example that probably comes up a lot in plugins.
>> I want to make a CSS file that gets some of its stuff from PHP.  So  
>> "mystyles.css.php".  Most of it is a simple echo, but a few things  
>> in the stylesheet are pulled from settings on the wp_settings table  
>> in the database.
>> The CSS/PHP file is pulled directly by the browser and is thus not  
>> "WP Aware".  How would I get that file to access the WP database?
>
> Short answer: you can't. Best option is to add a normal stylesheet  
> and then output any bits that depend on the db in a <style> tag  
> after that. This way WordPress won't run twice on each page load  
> (once to generate the HTML, second time to generate the stylesheet).
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list