Update proposal
-
Hi there. I’ve downloaded your plugin and noticed that the Galleria javascript files are loaded on every page. I’ve made a quick edit to your galleria-fs.php file so that they load only when actually used. My quick and dirty code look like that:
I’ve changed functions enqueue_scripts that starts on line 652 to look like that
{ global $fsg_ver; global $post; if( has_shortcode( $post->post_content, 'gallery') ) { $in_footer = !$this->options['load_in_header']; wp_enqueue_script('galleria', plugins_url('galleria-1.2.9.min.js', __FILE__), array('jquery'), '1.2.9', $in_footer); //wp_enqueue_script('galleria', plugins_url('galleria-1.2.9.js', __FILE__), array('jquery'), '1.2.9', $in_footer); wp_enqueue_script('galleria-fs', plugins_url('galleria-fs.js', __FILE__), array('galleria'), $fsg_ver, $in_footer); wp_enqueue_script('galleria-fs-theme', plugins_url('galleria-fs-theme.js', __FILE__), array('galleria-fs'), $fsg_ver, $in_footer); // register here and print conditionally wp_register_script('open-layers', plugins_url('OpenLayers.js', __FILE__), array('galleria-fs'), '2.12', $in_footer); wp_register_style('galleria-fs', plugins_url('galleria-fs.css', __FILE__), array(), $fsg_ver); wp_enqueue_style('galleria-fs'); } }
If it’s possible I would be grateful if you could implement this change (or use a better solution) in the next update. It would save me modyfying the file every single time.
Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Update proposal’ is closed to new replies.