• Resolved ruddyred

    (@ruddyred)


    Hi,
    The js minification works perfectly. I am having issue making the css work. I can use the site without it, but with it on, my site would load in a much much faster speed. I want that faster speed.
    I have been adding and removing a lot of my css from the exclusion list. Going through this forum. Deleting new plugins, nothing is working. The issue is the the sub header menu is messed up, and my video page fails to load the play button, plus other minor css issues.
    Do you know what it could be? Or what I need to exclude?

    https://ww.wp.xz.cn/plugins/autoptimize/

Viewing 15 replies - 1 through 15 (of 25 total)
  • Plugin Author Frank Goossens

    (@futtta)

    very hard to say without seeing your site, but in CSS-issues can be caused as AO by default aggregates & externalizes inline CSS, which makes it loose it’s priority (inline beats external).

    so you could remove all exclusions from CSS optimization and then force AO not to aggregate inline CSS by adding something like this (from autoptimize_helper.php_example) to your (child) theme’s functions.php (or better yet, a small helper plugin);

    add_filter('autoptimize_css_include_inline','ruddyred_ao_css_include_inline',10,1);
    function ruddyred_ao_css_include_inline() {
            return false;
    	}

    If that doesn’t help, I can have a look at your site (with AO CSS optimization active) to see what’s happening.

    frank

    Thread Starter ruddyred

    (@ruddyred)

    Hi Frank,

    I put the code in functions.php:

    // add_filter(‘autoptimize_css_include_inline’,’my_ao_css_include_inline’,10,1);
    function my_ao_css_include_inline() {
    return false;
    }

    It didn’t work out, please check the video and see the header and video wrapper styling is off:

    http://www.thehautie.com/v/dy3G7p9jm/

    Plugin Author Frank Goossens

    (@futtta)

    // compare the code you copy/pasted with mine and spot the essential difference 😉

    Thread Starter ruddyred

    (@ruddyred)

    sorry, I am not code-savy. I thought your code was for creating a plugin.

    Plugin Author Frank Goossens

    (@futtta)

    no problem, just remove the double slash at the start of this line;

    // add_filter('autoptimize_css_include_inline','my_ao_css_include_inline',10,1);

    Otherwise PHP considers the entire line as being comment and not code and the filter is not added really.

    frank

    Thread Starter ruddyred

    (@ruddyred)

    close. it centered my header, but the styling is still a little off. Didn’t change the video page though.

    Plugin Author Frank Goossens

    (@futtta)

    ok, focused on the menu for now. the problem is bootstrap.css is loaded from an external domain, which means it’s not aggregated and it loaded after the autoptimized css. different possible solutions for that, but I would start trying with the “inline all css”-option (which will force the inline AO-css to take precedence over the external bootstrap-one).

    frank

    Thread Starter ruddyred

    (@ruddyred)

    ok, should I remove the code from functions.php?

    Plugin Author Frank Goossens

    (@futtta)

    nah, keep it there for the time being, we’ll see if we can clean up afterwards.

    Thread Starter ruddyred

    (@ruddyred)

    that option didn’t change the menu

    Plugin Author Frank Goossens

    (@futtta)

    ok, gotta run now, but i’ll have a look later this evening/ tomorrow morning then.

    frank

    Thread Starter ruddyred

    (@ruddyred)

    ok

    Plugin Author Frank Goossens

    (@futtta)

    had a look, but css optimization appears to be off now so I can’t compare really. if you have a non-prod site where you can turn CSS-optimization on, then I could have a look there without it impacting your visitors?

    frank

    Thread Starter ruddyred

    (@ruddyred)

    It is turned on now

    Plugin Author Frank Goossens

    (@futtta)

    was already off to sleep 🙂

    do you have a non-production site?

Viewing 15 replies - 1 through 15 (of 25 total)

The topic ‘CSS issues’ is closed to new replies.