Php 我的嵌套中继器不是';不返回任何内容(Wordpress插件ACF)

Php 我的嵌套中继器不是';不返回任何内容(Wordpress插件ACF),php,wordpress,advanced-custom-fields,Php,Wordpress,Advanced Custom Fields,我有一个我将在下面展示的中继器,它既不返回任何错误,也不返回任何内容。(回声不工作) 我试图显示子字段officetype,但这是设置: Office(中继器)->Officetypeinfo(中继器)->多个子字段(例如officetype) 谁能告诉我我做错了什么,请告诉我,如果你需要比我提供的更多 <?php if( get_field('offices')): ?> <?php while( has_sub_field('offices')): ?>

我有一个我将在下面展示的中继器,它既不返回任何错误,也不返回任何内容。(回声不工作)

我试图显示子字段officetype,但这是设置:

Office(中继器)->Officetypeinfo(中继器)->多个子字段(例如officetype)

谁能告诉我我做错了什么,请告诉我,如果你需要比我提供的更多

<?php if( get_field('offices')): ?>
    <?php while( has_sub_field('offices')): ?>
        <?php if( get_sub_field('officetypeinfo')): ?>
            <?php while( has_sub_field('officetypeinfo')): ?>
                <?php
                    $show = the_sub_field('officetype');
                       echo $show;
                       the_sub_field('officetype');
                ?>
            <?php endwhile; ?>
        <?php endif; ?>
    <?php endwhile; ?>
<?php endif; ?>


提前谢谢

无需添加
_sub_字段('officetype')
echo$show之后

您是否检查了使用的字段名是否正确?
尝试
var_dump('field-name')
检查哪里出错。

我后来意识到我的结构不正确,删除了officetypeinfo子字段,并通过从while中删除该子字段来修复我的结构。不管怎样,谢谢你当时帮助我认识到这一点。