• I want to wp_enqueue twitter bootstrap css defaults into my site before the themes styles.css file loads. I don’t want to have to write !important all over the place and I’d like to see if it is possible to avoid hardcoding a <link> with it, which is what I’m doing right now.

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you are loading your style.css in header.php remove that then add and edit below to your functions.php file. Make sure you have the wp_head function in your header.php.

    add_action('wp_enqueue_styles', 'my_styles');
    function my_styles(){
        wp_enqueue_style('twitter', 'twitter-css-file-uri');
        wp_enqueue_style('theme-css', get_stylesheet_uri(), 'twitter');
    }
    Thread Starter mtpultz

    (@mtpultz)

    Thanks, that works great

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to wp_enqueue twitter bootstrap css before styles.css is loaded’ is closed to new replies.