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

Otto otto at ottodestruct.com
Mon Jul 14 19:09:19 GMT 2008


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.


However, contrary to what you said, I don't think that it is rigged to
work outside of the admin yet. I can't find where it would hook in.


More information about the wp-hackers mailing list