我有一个“fixtures”CPT的WP\\U查询,该CPT与另一个“fixtures\\u团队”CPT有关系。我想从fixtures\\u teams CPT中的相关团队中提取特征图像。
$query = new WP_Query( array(
\'post_type\' => \'fixtures\',
\'posts_per_page\' => -1,
\'meta_key\' => \'date\',
\'orderby\' => \'meta_value_num\',
\'order\' => \'ASC\',
));
if ( $query->have_posts() ) { ?>
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
<p class="team-name"><?php the_field(\'team_home\'); ?></p>
***<!-- here I want to get the featured-image from \'fixtures_teams\' where the CPT matches this \'team_home\' -->***
<p><span class="versus">V</span></p>
***<!-- here I want to get the featured-image from \'fixtures_teams\' where the CPT matches this \'team_away\' -->***
<p class="team-name"><?php the_field(\'team_away\'); ?></p>
<?php endwhile;
wp_reset_postdata(); ?>
提前感谢:)