Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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 3 years, 5 months ago by thinkjarvis.
    #1312719

    Hi 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.

    #1312724

    Hi @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 3 years, 5 months ago by thinkjarvis.
    #1312725

    Enfold Support –
    Please close the issue sorry problem solved!

    #1313161

    Hi,

    Great, I’m glad that you solved the problem, and thanks for the update. I’ll go ahead and close this thread for now then, please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Dequeue Parent theme custom.css’ is closed to new replies.