-
AuthorPosts
-
July 27, 2021 at 12:02 pm #1312707
Hi Guys,
I have an enfold site with child theme.
Is there a snippet you can send me to de-queue the parent theme custom.css file? It is empty but still getting served.
I cannot find a straight forward answer on the WP forums.
Thanks in advance.
-
This topic was modified 4 years, 2 months ago by
thinkjarvis.
July 27, 2021 at 12:44 pm #1312719Hi thinkjarvis,
You probably want to de-queue custom.css to improve performance. The better way to improve performance is to enable “CSS file merging and compression” at the Performance setting of the theme. This way only one CSS-file for the theme will be loaded and there is no need to de-queue any other CSS-files.
July 27, 2021 at 12:56 pm #1312724Hi @Emazing
I’ve solved it. Thank you for your input.
You are right. The script merge will remove the annotations and therefore the custom.css and style.css if they are not used.This is because of a specific problem. Enfold’s built in script merge wont work on a WPEngine site I am working on. It just ignores it no matter how many times the NGINX cache is cleared.
We are using WP-Rocket instead. I wanted to prevent the custom.css script loading fullstop because script merging is currently disabled – Pending testing.
I have used the following code which works:
// Dequeue and Reregister custom.css from parent theme add_action( 'wp_enqueue_scripts', 'enfold_remove_scripts', 9999 ); function enfold_remove_scripts() { wp_dequeue_style( 'avia-custom' ); wp_deregister_style( 'avia-custom' ); }-
This reply was modified 4 years, 2 months ago by
thinkjarvis.
July 27, 2021 at 12:56 pm #1312725Enfold Support –
Please close the issue sorry problem solved!July 29, 2021 at 5:32 am #1313161 -
This topic was modified 4 years, 2 months ago by
-
AuthorPosts
- The topic ‘Dequeue Parent theme custom.css’ is closed to new replies.
