WordPress高级自定义字段(ACF)宏库

我已经成功地使用ACF和magnific为网站上的单个视频创建了灯箱网格。

我有一个新页面来显示与ACF库字段匹配的灯箱图库

是否有任何方法可以放大以根据每个自定义帖子动态输出画廊?

我已在页脚中添加了此内容:

<script>
$('.gallery').each(function() { // the containers for all your galleries
    $(this).magnificPopup({
        delegate: 'a',// the selector for gallery item
        type: 'image',gallery: {
            enabled: true
        }
    });
});

和单个存档页面上的html

<section>

<div id="fade" class="content-grid">


    <?php
    while (have_posts()) {
        the_post(); ?>


        <a class="gallery" href="<?php echo get_field('image_gallery'); ?>">

            <div class="grid-item">

                <?php the_post_thumbnail('grid-size',['class' => 'image']); ?>


                <div class="overlay">
                    <div class="text">

                        <h3 class="grid-title"><?php the_title(); ?></h3>

                        <p class="grid-subtitle"><?php the_excerpt(); ?></p>

                    </div>
                </div>
            </div>
        </a>

    <?php }
    ?>


</div>

我可以看到它链接到了url中的一些正确数据,我只是想不出如何将其输出到宏伟的灯箱图库中

enter image description here

iCMS 回答:WordPress高级自定义字段(ACF)宏库

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2224674.html

大家都在问