ACF转发器字段返回空值

时间:2020-01-23 17:43:54

标签: php wordpress advanced-custom-fields acfpro

我正在尝试在自定义分类模板中包括一个Repeater字段,但是它一直返回没有帖子要显示。我知道有帖子要显示,所以我很困惑。
我尝试添加Features[*].properties[?contains(@,'website')=='true'].geometry.coordinates ,但没有做任何事情,我没有收到任何错误。

这是有问题的转发器:

wp_reset_postdata()

这是我的模板:

        <?php if( have_rows('feature_repeater') ): ?>
 <div class="related-posts">
        <h2>You May Also Like...</h2>
    <div>

    <?php while( have_rows('feature_repeater') ): the_row(); 

        // vars
        $image = get_sub_field('collection_image');
        $content = get_sub_field('collection_title');
        $link = get_sub_field('collection_link');

        ?>

        <div>

            <?php if( $link ): ?>
                <a href="<?php echo $link; ?>">
            <?php endif; ?>

                <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt'] ?>" />

            <?php if( $link ): ?>
                </a>
            <?php endif; ?>

            <?php echo $content; ?>

        </div>

    <?php endwhile; ?>


        </div>
</div>
<?php else : ?>

       No Posts to Display

<?php endif; ?>



0 个答案:

没有答案