$thiscat = get_queried_object();
$thiscat_id = $thiscat->term_id;
$posts = get_field('list', 'category_' . $thiscat_id);
if( $posts ): ?>
foreach( $posts as $p )
$name_id = get_field('name_id', $p->ID);
название:<?php echo $name; ?>
<?php
/**
* @var $thiscat WP_Term
* @var $posts WP_Post[]
*/
$thiscat = get_queried_object();
if ($posts = get_field('list', $thiscat)) {
foreach ($posts as $post) {
$name_id = get_field('name_id', $post);
$terms = get_the_terms($post, $thiscat->taxonomy); // массив всех категорий поста
}
}