Current best practice for WordPress plugin developers is to load javascript in the footer as this allows the page content to appear sooner for the visitor. I implemented this feature in Slickr Flickr 1.25 however a few users had problems so I have introduced a more flexible solution where you can now choose whether or not you want javascript loaded in the header or the footer.
Badly Configured Themes Have Problems Due To Missing Hooks
The users who had problems were where their WordPress theme had not implemented the ‘standard’ WordPress hook wp_footer. And because this hook was not called by the theme the javascript that was queued to be loaded in the footer never got loaded at all! Without the javascript being loaded the slideshow, galleries and galleries do not run.
Slickr Flickr Can Load Javascript In Either the Header or the Footer – You Choose
With Slickr Flickr 1.28 the javascripts will by default (once again) be loaded in the header, however you will be able to go into Slickr Flickr Admin Settings, and set the option ‘Load Scripts in Footer’. If this works for your theme then you should be fine to stick with this option.
Avoid Plugin Conflicts By Loading JavaScripts In The Header
Be aware of a potential plugin conflict when trying to load the javascripts in the footer that affects the Featured Content Gallery. Featured Content Gallery incorporates the mootools library which like jQuery uses the ‘$’ symbol. Even using jQuery.noConflict(), the two libraries conflict and give a Javascript error. So it you are using the excellent Featured Content Gallery plugin then you will need to use the default setting of loading Slickr Flickr javascript in the header.
Instructions
If you are not running Featured Content Gallery plugin go to Slickr Flickr Admin settings and set the ‘Load Scripts in Footer’ checkbox.
If your site still works well then stick with this configuration
If you site stops working, remove the tick in the checkbox and revert to loading javascript in the header.
Leave a Reply