Site logo

[Support request] Exclude hamburger menu from “Remove Unused CSS” WP feature

Home Forums Support [Support request] Exclude hamburger menu from “Remove Unused CSS” WP feature

Home Forums Support Exclude hamburger menu from “Remove Unused CSS” WP feature

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #1950292
    David
    Staff
    Customer Support

    Yeah best to take the issue to WP Rocket, as its their code thats doing the used/unused CSS function. Not sure how that works…

    #2125808
    Jesse

    Hi everyone,

    I had the same issue with my mobile hamburger menu not opening after enabling the Remove Unused CSS option in WP Rocket.

    I fixed it by adding the following to the CSS safelist:

    /wp-content/plugins/gp-premium/(.*).css

    However, this excludes all GP Premium CSS from the “Unused CSS” feature in WP Rocket. So I was curious if anyone has been able to narrow it down to the exact class or ID that needs to be safelisted, rather than safelisting the entire GP-Premium CSS file? This is a tricky one!

    Best regards,
    Jesse

    #2384456
    Matthew

    i’ve added this rule: /wp-content/themes/generatepress/assets/css/components/font-icons.min.css(.*)

    I don’t know if you need that bit at the end (.*). that narrows it down to 1 file. It appears that WP Rocket is losing the GeneratePress font which generates the burger menu.

    I do think that it’s quite important we are helped with this one as WP Rocket is used heavily in the wild. If it can be narrowed down to a class it would be even better.

    #2385105
    David
    Staff
    Customer Support

    If you set the Customizer > General > Icon Type to SVG, then GP won’t load the font-icons.min.css. So thats one less resource to load.

    I am not sure if exluding classes will fix the issue. The one common class for the hamburger would probably be: menu-toggle

    You could give that a try.

Viewing 4 posts - 16 through 19 (of 19 total)
  • You must be logged in to reply to this topic.