Display images in one row, hide all others [closed]

纵饮孤独 提交于 2020-01-17 19:23:18

问题


I'm working on custom Wordpress theme and have standard gallery lightbox:

My client want to edit gallery to this form:

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>

来源:https://stackoverflow.com/questions/59737126/display-images-in-one-row-hide-all-others

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!