简体   繁体   中英

FlexSlider carousel slides all images in first slide - WordPress

I am using the Nictitate theme my WordPress website.

The theme includes a client widget that simply displays client logos. I noticed that FlexSlider is being used on other widgets within the theme and so added some code to get the client logos in a carousel.

However, I cannot get this working properly. All the logos are grouped together in the first slide and then all disappear.

Can anyone help?

I have added the following code to widgets.php :

<div class="clients-slider flexslider">
  <ul class="slides">
     <?php


    while ( $clients->have_posts() ) : $clients->the_post();

        $client_url = get_post_meta( get_the_ID(), 'client_url', true );

        $thumbnail_id = get_post_thumbnail_id();

        $thumbnail = wp_get_attachment_image_src( $thumbnail_id, 'kopa-image-size-4' );

    ?>



        <li>

                <a href="<?php echo $client_url; ?>" target="_blank"><img src="<?php echo $thumbnail[0]; ?>" alt=""></a>

        </li>



    <?php


endwhile; ?>



</ul>
</div>

In custom.js :

jQuery(window).load(function() {

    jQuery('.clients-slider').flexslider({

        animation: "slide",

        animationLoop: false,

        itemWidth: 50,

        itemMargin: 5,

        minItems: 2,

        maxItems: 4,

        selector: ".slides > li",

        start: function(slider) {

            jQuery('body').removeClass('loading');

        }

    });

});

in http://leanneoleary.com/traincoachexcel.co.uk/wp-content/themes/nictitate-1.1.4/style.css line 1084

Remove this

.kopa-client-widget ul { width:1100px !important;}

After doing that, this is what I get:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM