[wp-hackers] Re: Plugins & CSS, embeded vs linking

Joost de Valk joost at joostdevalk.nl
Mon Jul 14 19:12:05 GMT 2008


On Jul 14, 2008, at 9:09 PM, Otto wrote:

> On Mon, Jul 14, 2008 at 1:56 PM, Kaspars Dambis
> <kaspars at konstruktors.com> wrote:
>>>> There is wp_enque_style() in WP 2.6 already. See:
>>>> http://trac.wordpress.org/browser/trunk/wp-includes/class.wp-
>>>> styles.php
>>>
>>> Does that already work outside of the admin area?
>>
>> Yes, it does work outside admin area. I just tried, but couldn't  
>> figure
>> out how to order the stylesheets.
>
> Same as with the script enqueing, you use dependencies.
>
> wp_register_style('parent','/path/to/parent.css',array(), '1.0' );
> wp_register_style('child','/path/to/child.css',array('parent'),  
> '1.0' );
>
> wp_enqueue_style('child');
>
> The child depends on the parent, so the result will be the parent
> first followed by the child.

This means it would add multiple css files instead of one big one?

- Joost


More information about the wp-hackers mailing list