$staff = get_pages(array());
foreach ($staff as $staffs);
<div>the_field('название поля', $staffs->ID)</div>$doctors = get_field('doctors');
if( $doctors ): ?>
<ul>
<?php foreach( $doctors as $post):
<?php setup_postdata($post); ?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <!--Выводим ссылку на страницу доктора-->
</li>
<?php endforeach; ?>
</ul>
<?php wp_reset_postdata(); ?>
<?php endif; <?php
$number = 0;
$doctors = array();
?>
<?php foreach($categories as $category): ?>
<?php $staff = get_pages(array('parent' => $category->ID)); ?>
<li>
<div class="uk-position-relative uk-visible-toggle uk-light doctors_tab_slider" tabindex="-1" uk-slider>
<div class="uk-slider-container">
<ul class="uk-slider-items" uk-switcher="connect: #component-nav;">
<?php foreach($staff as $doctor): ?>
<?php $doctors[] = $doctor; ?>
<?php $image = get_field('doctor_image', $doctor->ID); ?>
<li class="uk-width-1-6 centred-items" data-number=<?php echo $number++; ?>>
<div class="uk-position-center uk-panel slider__wrap uk-flex uk-flex-center">
<div class="inner__wrap"><img class="round__slider" src="<?php echo $image ?>"></div>
</div>
<h4 class="title is-6"<a href="<?php echo get_page_link( $doctor->ID ); ?>"><?php echo $doctor->post_title; ?></a></h4>
<p class="title is-7"><?php the_field( 'doctor_education' ); ?></p>
</li>
<?php endforeach; ?>
</ul>
</div><a class="uk-position-center-left uk-position-small header__arrow-pref" href="#" uk-slider-item="previous">
<svg class="icon" width="26px" height="33px">
<use xlink:href="#icon-prev"></use>
</svg></a><a class="uk-position-center-right uk-position-small header__arrow-next" href="#" uk-slider-item="next">
<svg class="icon" width="26px" height="33px">
<use xlink:href="#icon-next"></use>
</svg></a>
<ul class="uk-slider-nav uk-dotnav uk-flex-center uk-margin"></ul>
</div>
</li>
<?php wp_reset_postdata(); ?>
<?php endforeach; ?>
,