[Resolved] Dequeuing css files like featured-images

Home Forums Support [Resolved] Dequeuing css files like featured-images

Home Forums Support Dequeuing css files like featured-images

  • This topic has 4 replies, 2 voices, and was last updated 2 years ago by Fernando.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2188109
    iQfy Media

    I bought GeneratePress because it was listed as one of the 10 fastest themes in a test, and it hasn’t disappointed. With some tweaking I’ve gotten my PageSpeed score to 93 for mobile and 99 for desktop, and all green on all the metrics except Largest Contentful Paint on mobile.

    So there are still some tweaks I’d like to do. Some of the css files each add around 150 milliseconds to my renderblocking time, and I’d like to include them in my “custom css” file instead of loading them separately (featured-images.min for example). But, neither wp_deregister_style nor wp_dequeue_style work to stop them from being loaded. I use these wordpress functions to remove css loads from plugins just fine, but not the theme.

    Ideas?

    #2188111
    iQfy Media

    PS. I’m aware there are plugins that collapse all css and js into single files but for various reasons that isn’t ideal for me.

    PS2. If you added a “power user” panel to options where you can selectively unload a bunch of stuff, hopefully without adding extra mysql queries to each pageload, that would put you way ahead of the competition.

    #2188172
    Fernando
    Customer Support

    Hi there,

    With regards to dequeueing styles, kindly read Elvin’s response here: https://generatepress.com/forums/topic/have-me-function-to-remove-css-and-javascript/#post-1608711

    Example of how to implement it: https://generatepress.com/forums/topic/have-me-function-to-remove-css-and-javascript/#post-1608861

    In the same thread, kindly take note of this as well: https://generatepress.com/forums/topic/have-me-function-to-remove-css-and-javascript/#post-1608913

    Hope this helps! Kindly let us know if further assistance regarding this is needed. 🙂

    #2188187
    iQfy Media

    Thank you.

    Stylesheet ID (minus the “-css” at the end) was what I needed, not the stylesheet filenames. So wp_deregister_style(‘generate-blog-images’); did the trick.

    #2188188
    Fernando
    Customer Support

    You’re welcome! Glad that worked! Feel free to reach out anytime you’ll need assistance with anything else. 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.