我有一个静态页面,其中有一个高级自定义字段 (ACF) 的“中继器”区域和一些用于拉入一些自定义帖子的代码。
我在页面顶部有这段代码。
<?php get_header(); the_post(); query_posts('post_type=team_profiles') ?>
如果这样离开,我会看到我的帖子,但看不到来自 ACF 的数据。如果我取出以下部分:
query_posts('post_type=team_profiles')
我看到了 ACF 字段,但没有看到发布数据。
我的问题首先是为什么会发生这种情况,其次是如何将它们放在同一页面上?
我的静态页面中 ACF 和 POSTS 的代码如下:
ACF 中继器字段
<?php if( get_field('about_sections') ): ?>
<?php while( has_sub_field('about_sections') ): ?>
<div class="asset image">
<?php the_sub_field('about_section'); ?>
</div> <!-- asset image -->
<?php endwhile; ?>
<?php endif; ?>
帖子
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content-single-team-profile', get_post_format() ); ?>
<?php endwhile; ?>
<?php endif; ?>