我在一个 WP 项目中。我创建了一个名为的自定义帖子类型Team Members
我还创建了一个自定义字段块,其中包含一个名为的字段,该字段是一个转发器,并有两个名为和contact_members
的子字段。此子字段与自定义帖子类型相关。location_map
member
member
team member
我对获取location_map
. 问题是我无法获取帖子类型字段。(来自contact_members->member->post type
<?php
$members = get_field('contact_members');
?>
@foreach($members as $member)
<div class="member {{ $member['location_map'] }}">
<img class="map" src="{{ get_the_post_thumbnail_url($member['member']->ID) }}">
<h3>{{ get_the_title($member['member']->ID) }}</h3>
<p class="position">{{ $member['member']->position }}</p>
<p class="location">{{ $member['member']->location }}</p>
<a href="#">Contact</a>
</div>
@endforeach