I'm trying to Deregister and Dequeue 3 Stylesheets from a Plugin (WP Listings) and Enqueue 3 Stylesheets within my Child Theme's directory.
I have tried using the following code, but all 3 of the plugins stylesheet still load before the child stylesheets.
Here's the code I've tried:
//* Load WP Listings Style Sheet from Child Theme
add_action( 'wp_enqueue_scripts', 'load_alta_styles' );
function load_alta_styles() {
wp_dequeue_style( 'wp_listings' );
wp_deregister_style( 'wp_listings' );
wp_dequeue_style( 'wp_listings_widgets' );
wp_deregister_style( 'wp_listings_widgets' );
wp_dequeue_style( 'wp_listings_single' );
wp_deregister_style( 'wp_listings_single' );
wp_enqueue_style( 'wp-listings-child', get_stylesheet_directory_uri() . '/css/wp-listings.css' );
wp_enqueue_style( 'wp-listings-widgets-child', get_stylesheet_directory_uri() . '/css/wp-listings-widgets.css' );
wp_enqueue_style( 'wp-listings-single-child', get_stylesheet_directory_uri() . '/css/wp-listings-single.css' );
}
Can anyone point out where I could be going wrong?
Thank you.
priority
foradd_action()
. – kaiser Feb 9 '15 at 15:04