The MU forums have moved to WordPress.org

wp_head() (3 posts)

  1. realsol
    Member
    Posted 15 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.

  2. dsader
    Member
    Posted 15 years ago #

    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".

  3. realsol
    Member
    Posted 15 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.

About this Topic