Archived topic
Using custom function in child theme
3 replies · Started by Anonymous on November 15, 2015
Viewing posts 1–4 of 4
Hi,
I use my function to load my css file
add_action( 'wp_enqueue_scripts', 'my_styles' );
function my_styles() {
$subdb = array_shift((explode(".",$_SERVER['HTTP_HOST'])));
wp_enqueue_style( $subdb, get_stylesheet_directory_uri().'/'. $subdb .'.css' );
}
but it's loaded above the generate-style-inline-css.css link tag, so I can't overwrite the default style without !important, is this normal custom style appears above generate-style-inline-css.css ? how to make it loaded last?
Add a priority to your action:
add_action( 'wp_enqueue_scripts', 'my_styles', 999 );
That should do it :)
ahh thanks, this is a wordpress questions, sorry :D
No worries :)
This archived topic is closed to new replies.
