Skip to:
Content
Pages
Categories
Search
Top
Bottom

Javascript Conflicts

  • I have a gallery on my homepage that uses javascript, but I’ve noticed that the JS is always running, even when I’m not on my homepage. This is creating a conflict with my avatar uploads, and will not allow me to crop my image or preview it. When I deactivate the plugin, all works fine, but that’s not an option with my site.

    Since I don’t really need (or want) my gallery plugin’s javascript running on my member pages anyway, is it possible for me to essentially “deactivate” the homepage gallery’s javascript when a user isn’t on the homepage?

    Conversely, is there a way to make it so my gallery plugin’s javascript is ONLY activated on the homepage?

    There must be some way to avoid the Javascript conflicts…I just don’t know how…

    Thanks for the help.

Viewing 4 replies - 1 through 4 (of 4 total)

  • Marco72
    Participant

    @marco72

    That is because javascript is called in the header.php.

    You can duplicate header.php, name the new file as u like, es. nojheader.php, open and delete the strings that call the javascript for the gallery,

    Then you should replace in the beginning of the other templates pages the string get header.php to get nojheader.php. Hope is clear…

    Actually the gallery is a plugin, so my actual header doesn’t have any JS in it. It is coming straight from the plugin.

    This is a problem with a plugin so support questions should go to wherever you got that from. In general though, there are functions such as is_home is_single etc. If you only want the gallery JS on your homepage, you’ll need to use is_home as a check wherever the plugin includes its JS.


    Burt Adsit
    Participant

    @burtadsit

    What djpaul said. Turning off the lights in the room.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Javascript Conflicts’ is closed to new replies.
Skip to toolbar