Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jorge Silva-Jetter

    (@jorgesilva-1)

    Can you be a bit more specific about what the issue is. Which JS files are we talking about here? Can you explain the has_shortcode function and how it’s relevant to this? I’m sorry but I don’t understand the relationship between the shortcode and the JS file. That’d be great!

    I’m always happy to optimize the plugin and try to make it better! Thanks for the comment.

    The plugin load the js in the home page or page that not have the gallery shortcode.
    With has_shortcode you can check if the post content have the shortcode and load the js file only on the page that needed.

    Plugin Author Jorge Silva-Jetter

    (@jorgesilva-1)

    I think this would be more of a setting that you would turn on/off because you might want to use the plugin without the short code, or with the shortcode in your template and not your content, or you might have AJAX functionality on your site (like my site has). In all these cases, it might be hard to effectively and elegantly include these scripts only as necessary.

    I think the way it would work is that this would be turned off by default (to avoid problems for less tech-savvy users), but you could turn it on. It would read something like:

    “If you are only using this plugin for galleries in your main content and are not using Javascript, you should turn on this feature in order to include javascript files only when necessary.”

    …something like that.

    What do you think?

    Like I mentioned in the other thread, this will probably make it to the next revision, in a few weeks.

    Thanks for the suggestions?

    Plugin Author Jorge Silva-Jetter

    (@jorgesilva-1)

    This feature is in the new version of the plugin. There is an advanced option for it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Load js file only when used the gallery’ is closed to new replies.