From 68aa66d5498d6b9d73bd6b1b583987e418af6772 Mon Sep 17 00:00:00 2001 From: Braad Date: Mon, 1 Jun 2015 11:29:37 -0700 Subject: [PATCH] Move CSS enqueue to a later hook to come after plugins --- includes/functions/theme-functions.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/includes/functions/theme-functions.php b/includes/functions/theme-functions.php index b3e2bea..e5f8b21 100755 --- a/includes/functions/theme-functions.php +++ b/includes/functions/theme-functions.php @@ -31,6 +31,18 @@ function trestle_add_theme_support() { } +add_action( 'after_setup_theme', 'trestle_remove_genesis_css_enqueue' ); +/** + * Stop Genesis from enqueuing the child theme stylesheet in the usual way. + * + * @since 2.1.0 + */ +function trestle_remove_genesis_css_enqueue() { + + remove_action( 'genesis_meta', 'genesis_load_stylesheet' ); + +} + /*=========================================== * 3rd Party Libraries ===========================================*/ @@ -63,7 +75,7 @@ function trestle_load_bfa() { * Header ===========================================*/ -add_action( 'wp_enqueue_scripts', 'trestle_header_actions' ); +add_action( 'wp_enqueue_scripts', 'trestle_header_actions', 15 ); /** * Loads theme scripts and styles. * @@ -71,6 +83,9 @@ add_action( 'wp_enqueue_scripts', 'trestle_header_actions' ); */ function trestle_header_actions() { + // Our main stylesheet. + wp_enqueue_style( 'trestle', get_stylesheet_uri(), array(), TRESTLE_THEME_VERSION ); + // Google fonts. wp_enqueue_style( 'theme-google-fonts', '//fonts.googleapis.com/css?family=Lato:300,400,700' );