Home Forums General Issues Gallery slider problem


Gallery slider problem

  • Hi,

    I have a flexslider there shows images from gallery field and i works perfect.

    But the javascript to the slider ruin all the other javascript functions on the page where the slider is, are there someone there who has an idea for a solution.

    The code:

    $images = get_field('gallery');
    if( $images ): ?>
        <div id="slider" class="flexslider">
            <ul class="slides">
                <?php foreach( $images as $image ): ?>
                        <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
                        <p><?php echo $image['caption']; ?></p>
                <?php endforeach; ?>
    <?php endif; ?>
      <!-- jQuery -->
      <script src=""></script>
      <script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.min.js">\x3C/script>')</script>
      <!-- FlexSlider -->
      <script defer src="js/jquery.flexslider.js"></script>
      <script type="text/javascript">
            animation: "slide",
            start: function(slider){

    Thank you

  • Hello Asger,
    functions is the best place to call all scripts(javascripts) and styles.
    Syntax highlighting is not necessary in real life project.

    The code below is enough to make flexslider work.

      <script type="text/javascript">
            animation: "slide",

    Please, make sure that you have added call to flexslider.css and place flexslider’s font in proper place as well.

  • Hello Rajat,
    thanks for your reply

    I have solved my problem with the help from this video –>


Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Gallery slider problem’ is closed to new replies.