• Resolved 3Lancer

    (@3lancer)


    Hi,

    I’m trying to minify WordPress jQuery in the header:

    <script src="/wp-includes/js/jquery/jquery.js" type="text/javascript"></script>
    <script src="/wp-includes/js/jquery/jquery-migrate.min.js" type="text/javascript"></script>

    I use Header with “async” loading…

    This works fine, but on the homepage there is a RevSlider which loads at the bottom of the page, right before the </body> tag:

    <script src="/wp-content/plugins/revslider/public/assets/js/jquery.themepunch.tools.min.js" defer="defer" type="text/javascript"></script>
    <script src="https://www.artrage.com/wp-content/plugins/revslider/public/assets/js/jquery.themepunch.revolution.min.js" defer="defer" type="text/javascript"></script>

    These are only loaded on the homepage so haven’t been added to the minify. The webpage loads, but the RevSlider is blank upon first load. If you move off the page and come back or force refresh, the RevSlider appears.

    It’s not loading the RevSlider on first time viewing.

    Would this be an issue with the “async”? I was attempting to prevent the blocking of page load.

    Also, another question: Should I add Google fonts into W3 css minify or just leave that out:
    <link id="google-fonts-css" href="//fonts.googleapis.com/css?family=Open+Sans%3Alighter%2Cnormal%2Csemi-bold%2Cbold%7CPT+Sans%3Alighter%2Cnormal%2Csemi-bold%2Cbold" rel="stylesheet" type="text/css" media="all">

    https://www.ads-software.com/plugins/w3-total-cache/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Typically you can’t async or move JQuery because it needs to be run before the sliders inline JS and the files it outputs. Just let JQuery alone and it should work. (JQuery Migrate can try to be combined i find a lot less issues with it).

    Just leave the Google Fonts where they are is good enough.

    Thread Starter 3Lancer

    (@3lancer)

    @destac – Thanks for your reply. You are correct.

    I was planning to swap WordPress local jQuery with a Google hosted one and async it. However, logically jQuery should be loaded early as possible incase the webpage has document onload using it, etc. It will probably just delay it’s wait longer or run into issues. I’ve moved it back out.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘jQuery minify when using RevSlider’ is closed to new replies.