realsol
Member
Posted 14 years ago #
I want a custom plugin that will add to the head before the body (sorry about lack of tags, not sure what I can type here that is allowed).
wp_head is the best spot, but I need my option to be the last in the head. How can I add something and make sure it is after all other styles.
Thanks.
Early in the header
add_action('wp_head', 'add_style', -1);
or later
add_action('wp_head', 'add_style', 11);
Any integer will alter the load order of an action hook or filter.
Get yourself a Hooks & Filters "load order" script and you can investigate/troubleshoot your plugins with a bit more insight.
You'll likely see many hooks to wp_head load at priority 10, that's the default. You may need to jigger other plugins to straighten out exactly when everything "flows".
realsol
Member
Posted 14 years ago #
Thanks. I tried add_action('wp_head', 'add_style', 1), add_action('wp_head', 'add_style', 10) and add_action('wp_head', 'add_style', 9), and i always stayed in the same place. My goal is to have an additional stylesheet called after my main theme's, which is the 2nd to last.
I will take a look a the link. Thanks a lot.