Support

Account

Home Forums General Issues Multiple flexsliders on 1 page

Helping

Multiple flexsliders on 1 page

  • Hello, I created a Flexslider with thumbs carousel using repeater for custom single post, that should be shown with others posts on some category page. It works fine when its just 1 flexslider on the page, but when I add more posts with slider, just the last one appears, and others are not. Is there any hook to working all sliders on one page?

    Here php:

    <section class=”portfolio-section”>
    <div class=”container”>
    <h1><?php single_post_title() ?></h1>
    <?php $args = array(‘post_type’ => ‘work’,
    ‘posts_per_page’ => 50,);
    $property = new WP_Query( $args );
    if( $property->have_posts() ) : ?>
    <?php while( $property->have_posts() ) :
    $property->the_post();
    // тут выводим пост ?>
    <div class=”portfolio-item”>
    <div class=”portfolio-image”>
    <?php the_post_thumbnail(‘full’); ?>
    <div class=”galery-work”>
    <?php if (have_rows(‘grid_img’)): ?>
    <div class=”grid_img”>
    <?php while(have_rows(‘grid_img’)) : the_row();

    $image = get_sub_field(‘image’); ?>
    ” alt=”” />
    <?php endwhile; ?>
    </div>
    <?php endif; ?>

    </div>
    </div>

    js

    $(window).on(‘load’, function() {
    // The slider being synced must be initialized first
    $(‘#carousel’).flexslider({
    animation: “slide”,
    direction: ‘vertical’,
    controlNav: false,
    animationLoop: true,
    slideshow: true,
    itemWidth: 150,
    itemMargin: 5,
    asNavFor: ‘#slider’
    });

    $(‘#slider’).flexslider({
    animation: “slide”,
    controlNav: false,
    animationLoop: true,
    slideshow: true,
    sync: “#carousel”
    });
    });

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.