Oh yesss, it worked out! All i needed to do was delete that plugin and everything seems fine now! 🙂 Thanks a ton for the help!
I was so worried about this thing for past few days because i just couldnt delete autoptimize because how well its optimized my site for speed so i needed to fix the error which is finally resolved! Thanks again! =)
Just wondering what if I have to use that plugin in future? The problem will be back again!
It didn’t work out actually! :/ I just deleted the plugin along with that line of code form CSS exclusion but the icon still not showing up!
my bad; the problem is with the fact that plugins/meks-flexible-shortcodes/css/simple-line/simple-line-icons.css
is loaded with media="screen"
vs themes/cream-magazine/assets/dist/css/main.css
with media="all"
, resulting in 2 autoptimized CSS-files and the screen
-one is loaded after the all
one so the order of CSS is implicitly changed.
workaround code snippet;
add_filter('autoptimize_filter_css_tagmedia','check_mediatype',10,2);
function check_mediatype($media,$tag) {
if ( strpos($tag,"plugins/meks-flexible-shortcodes/css/") !== false ) {
$media=array("all");
}
return $media;
}
Or ask the meks-flexible-shortcodes developer to enqueue CSS with media=”all” instead of media=”screen” 🙂