Display images in one row, hide all others [closed

2020-01-20 15:21发布

I'm working on custom Wordpress theme and have standard gallery lightbox: enter image description here

My client want to edit gallery to this form: enter image description here

All items should be displayed in one row, three colums and the last window should display count of remaining items in gallery, and after click on it display them...(I don't know if in grid or something elses) I really have no idea how to do this. I found nothing on entire web.

<div class="container mt-5">
    <div class="row">

    <?php
    $images = get_field( 'galeria' );

    if ( $images ) :
        foreach ( $images as $image ) : ?>

                <div class="col-12 col-sm-6 col-md-4">
                    <a href="<?php echo $image['url']; ?>" data-fancybox="gallery">
                         <img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" class="d-block mx-auto">
                    </a>
                    <p><?php echo $image['caption']; ?></p>
                </div>

        <?php endforeach; 
    endif; ?>

    </div>                      
</div>

0条回答
登录 后发表回答