F
F
freeman02042018-10-21 18:08:56
WordPress
freeman0204, 2018-10-21 18:08:56

Loading ajax images on a single, how?

I used this lesson to load posts https://misha.blog/wordpress/ajax-pagination.html and I succeeded. But here the situation is different. At me to be deduced through acf Repeater of a picture on a single.

<?php if ( have_rows( 'gallery', $post->ID ) ): ?>
                <?php while ( have_rows( 'gallery', $post->ID ) ): the_row(); ?>
                                    <div class="col-md-6 col-lg-4 item">
                    <?php $images = get_sub_field( 'images', $post->ID ); ?>
                                        <a class="lightbox" href="<?php echo $images['url']; ?>">
                                            <img src="<?php echo $images['url']; ?>"
                                                 class="img-fluid image scale-on-hover"
                                                 alt="<?php echo $images['alt'] ?>"/>
                                        </a>
                                    </div>
                <?php endwhile; ?>
              <?php endif; ?>


How to make images loaded on ajax when scrolling in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
EvgenyMorozov, 2018-10-22
@EvgenyMorozov

You probably don't need ajax, but lazy load images

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question