Archived topic
puling css from wordpress core file in to child theme
3 replies · Started by olusegun on November 18, 2019
i am currently trying to optimize my site, while using chrome dev tools to see the css file being loaded. i came across a css file in wordpress core with the url: https://muzzmusic.com/wp-includes/css/dist/block-library
/style.min.css?ver=5.3 and total size of 41,467 bytes and i only require less than 2% of the file to load my individual post. i have copied out the required code for my post to load but i dont know how to add it to my child theme and instruct wordpress to go and load the reduced version of the code from my child theme instead of loading it from wordpress core
Hi there,
this topic here explains how to dequeue the style sheet:
Then its simply a case of including the styles you require in your child theme style sheet.
Thanks David it worked perfectly.
Please how do i remove css codes from generatepress and gp premium files (/themes/generatepress/css/unsemantic-grid.min.css?ver=2.3.2, gp-premium/menu-plus/functions/css
/offside.min.css?ver=1.8.3)
Taking this two files as an example
Unsemantic - best thing is to check Combine CSS in Customizer > GeneratePress then it will only load the essential CSS the theme requires.
I believe offside CSS is a dependency so cannot be removed.