• SJW

    (@whitsey)


    I have loaded some JS in the footer using minify.

    I assumed that W3TC loaded in wp_footer() but I was clearly mistaken.

    After wp_footer() I have some code as follows

    <?php wp_footer(); ?>
    <script>
    	(function($) {
    		$(document).foundation();
    	})(jQuery);
    </script>

    This jQuery function is throwing an Uncaught TypeError because w3TC is loading after wp_footer()

    How do I

    a) Force W3TC to load in wp_footer()
    OR
    b) Hook into the action W3TC is using to load the JS after W3TC?
    OR
    c) Load my JS after the minified JS include

    https://wordpress.org/plugins/w3-total-cache/

Viewing 1 replies (of 1 total)
  • Thread Starter SJW

    (@whitsey)

    Ok. Given previous experience on this forum I figured waiting for an answer might takes days so I came up with a workaround.

    For those with a similar issue.

    I created a new js file js/custom.js

    I added this code to the file:

    (function($) {
    		$(document).foundation();
    	})(jQuery);

    And then I added it as the last file in JS minify in the </body> section

Viewing 1 replies (of 1 total)
  • The topic ‘Problem Loading Minified JS in Footer’ is closed to new replies.