WordPress.org

Ready to get started?Download WordPress

Forums

Changing add_action('wp_head',...) execution priority? (3 posts)

  1. Trahald
    Member
    Posted 5 years ago #

    I'd like to override the styles set by theme stylesheets, without editing the stylesheets themselves.

    However when I do this by adding an action to wp_head, the action executes prior to the head section where the theme stylesheets are set. So the CSS in the theme stylesheets overrides the CSS in my custom action.

    add_action('wp_head', 'header_css_style');
    
    function header_css_style()
    {
    	echo "<style type=\"text/css\">
    body { background-color: #FFFFFF; }
    </style>\n";
    }

    Is it possible for me to add CSS styling to the header that executes after the theme stylesheets are set?

  2. Trahald
    Member
    Posted 5 years ago #

    Still wondering about this :)

  3. johnkolbert
    Member
    Posted 4 years ago #

    Without moving the location of the wp_head() function in the theme itself, I don't think so, at least not that I know of. Sorry!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.