I have some code, namely -
<?php while (has_sub_field('services_featured_links')) {
$postObjects = get_sub_field('services_link');
if($postObjects){ ?>
<ul class="intro-menu">
<?php foreach($postObjects as $post){
setup_postdata($post); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php
}
wp_reset_postdata();
}
?>
</ul>
<?php } ?>
I have 4 post objects in my repeat fields - at the moment, utilising this code returns a lot of empty li and a tags. It also returns the parent page as a link.
I basically just need to get the permalink and title of each post object I have selected.
Any help please?