views:

128

answers:

4

Using wordpress 2.9.2. I am loading my css files for plugins as they are being called, which ofcourse is after my header has been loaded. I want to insert the calls those css files in the HEAD tag of the page, which can be done if i get a hook which includes lines in the head after wp_head() has been called. Help !

A: 

Have you tried echoing the styles or .css include the in a function passed into wp_print_styles API action hook?

cowbellemoo
A: 

If you are using your own theme, you can just put <style> tags in your header.php file pointing to the stylesheets you are using.

If you need a hook, it is called wp_head (check the Codex documentation on it).

Nicholas Wilson
A: 

The solution that worked for me was inserting the css files in head using output buffer.

Umair
A: 

Look at http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head - the action is called wp_head.

You will want to use wp_register_style() to register your CSS file followed by wp_enqueue_style() to actually add it to the list of stylesheets that are output.

There is an example on that page, but replace 'wp_print_styles' in the example with 'wp_head'.

Dan Smart