• Resolved Liz

    (@lizery)


    I’m having an issue with the plugin loading jQuery and its css file in the header of my page. Ideally I would like it to load in the footer with my other scripts in plugins to keep in line with page speed standards.
    When I check “Do not include standard WordPress jQuery library” – the plugin breaks. Even though wp’s default jQuery is being called, the plugin does not wait for it to load and inserts itself too soon. Is there a way to force the plugin wait for jQuery to load?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, Easy FancyBox just states jQuery as a dependency and by default, WordPress will load jQuery in the header. But there are plugins that allow the library to be loaded in the footer.

    Even though wp’s default jQuery is being called

    I suppose this is by another plugin or by the theme? If jQuery is in the footer, but after Fancybox script files are loaded, then you can use the option “Script priority” to move the Fancybox script files “down” in load order, by increasing the priority number. Try any number above 10 (start with 11 but if that does not fix it, a higher number like 99) and it should start working at some point 🙂

    Thread Starter Liz

    (@lizery)

    That was helpful, thank you. For anyone else looking I also had to remove wp_print_scripts, wp_print_head_scripts, & wp_enqueue_scripts from wp_head and add to wp_footer to get it all loading in the right order in the footer.

    I still can’t get the fancybox css to load in the footer with my other scripts and styles, but not having jquery up there was the most important thing.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Assets loading in header’ is closed to new replies.