Tagged: child theme, stylesheet
-
AuthorPosts
-
June 12, 2019 at 11:04 pm #1109619
Hi,
I’m trying to load a different, minified stylesheet with a timestamp for my Enfold child theme. I keep loading both style.css (ID = avia-style-css) and style.min.css. Am I dequeuing the wrong handle?
function my_child_styles() { wp_dequeue_style( 'avia-style-css' ); wp_deregister_style( 'avia-style-css' ); wp_enqueue_style( 'my-child-style', get_stylesheet_directory_uri() . '/style.min.css', '', filemtime( get_stylesheet_directory() ) ); } add_action( 'wp_enqueue_scripts', 'my_child_styles', 100 );
I don’t have a production site for this. All local.
Thanks
johncoryJune 13, 2019 at 5:55 pm #1109950Hey johncory,
It could be good if we can see it somehow, but how is this possible?
Best regards,
BasilisJune 13, 2019 at 9:20 pm #1110106Sorry, I don’t have this on a production site.
Here’s the source from my local site:
<link rel='stylesheet' id='avia-custom-css' href='http://test.loc/test/wp-content/themes/enfold/css/custom.css?ver=4.5.7' type='text/css' media='all' /> <link rel='stylesheet' id='avia-style-css' href='http://test.loc/test/wp-content/themes/enfold-child-test/style.css?ver=4.5.7' type='text/css' media='all' /> <link rel='stylesheet' id='my-child-style' href='http://test.loc/test/wp-content/themes/enfold-child-test/style.min.css?ver=1559080088' type='text/css' media='all' />
June 14, 2019 at 6:03 pm #1110401Hi johncory,
We need to see the actual css and html to be able to propose a solution for you. Please get back to us when you get the website to some testing server.
Best regards,
VictoriaJuly 25, 2019 at 1:20 am #1121788Nevermind.
- This reply was modified 5 years, 5 months ago by johncory. Reason: Removing private info
July 25, 2019 at 7:44 pm #1121965Aha.
Even though the style.css displays the ID ‘avia-style-css’ it is originally enqueued by enfold as ‘avia-style’ with no ‘css.’
So, if someone else wants to do this and can’t figure it out, try this:
add_action( 'wp_enqueue_scripts', 'enfold_remove_scripts', 9999 ); function enfold_remove_scripts() { wp_dequeue_style( 'avia-style' ); wp_deregister_style( 'avia-style' ); }
And look to Enfold functions.php section “Register frontend javascripts” when you’re trying to find the style enqueues.
July 28, 2019 at 11:11 pm #1122589Hi,
Thanks for sharing your solution, I assume we can close this now?Best regards,
MikeMarch 7, 2021 at 8:36 pm #1286229this is killing all styles°!
March 7, 2021 at 10:28 pm #1286246Hi, @Rafíyel,
this is what this person wanted to do, we are going to close this very old thread.
If you have any questions please create a new thread.Best regards,
Mike -
AuthorPosts
- The topic ‘How to dequeue avia-style-css’ is closed to new replies.