Created
May 12, 2015 20:40
-
-
Save ejntaylor/7320fb626227f7959a1c to your computer and use it in GitHub Desktop.
ReOrder LayersWP Child Style Load Order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Remove Layers added Child Styles | |
add_action( 'wp_enqueue_scripts', 'remove_default_layers_child_stylesheet', 20 ); | |
function remove_default_layers_child_stylesheet() { | |
wp_dequeue_style( LAYERS_THEME_SLUG . '-style' ); | |
wp_deregister_style( LAYERS_THEME_SLUG . '-style' ); | |
} | |
// Add Re-Ordered CSS | |
function layers_apply_inline_styles_new(){ | |
global $layers_inline_css; | |
$layers_inline_css = apply_filters( 'layers_inline_css', $layers_inline_css ); | |
wp_enqueue_style( | |
LAYERS_THEME_SLUG . '-inline-styles', | |
get_template_directory_uri() . '/assets/css/inline.css' | |
); | |
wp_add_inline_style( | |
LAYERS_THEME_SLUG . '-inline-styles', | |
$layers_inline_css | |
); | |
wp_register_style( 'bambino-style-css', get_stylesheet_directory_uri() . '/style.css', false, '1.0.0' ); | |
wp_enqueue_style( 'bambino-style-css' ); | |
} | |
add_action( 'get_footer' , 'layers_apply_inline_styles_new', 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment