js script loading on certain pages only (4 posts)

  1. lateralus-
    Posted 7 years ago #


    Due to js libraries conflicts (a mootools powered slideshow and the lightbox plugin for example), i'm looking for a way to have the mootools library loading in the front page only. That way other plugins using different javascript libraries can load in all the other pages without being in conflict with mootools.

    thanks !

  2. lateralus-
    Posted 7 years ago #

    No idea ?

  3. Darran
    Posted 7 years ago #

    You can make use of the conditional tags to decide where you want to include the JS files.

    <?php if (is_front_page()) { ?>
    <!-- include your JS script here -->
    <?php } ?>

    I hope this helps.

  4. Tommie Hansen
    Posted 7 years ago #

    You could use Slimbox for mootools instead of the original lightbox. It works the same way and also make use of rel="lightbox" so the switch would be quite transparent (if you haven't edited your lightbox code that is).

    Example useage here;

    (Gallery uses a slightly modified version of Nextgen Gallery by Alex Rabe)

    Good luck!

Topic Closed

This topic has been closed to new replies.

About this Topic