Support

Account

Home Forums General Issues gettimg custom field values from parent and grandparent page? Reply To: gettimg custom field values from parent and grandparent page?

  • Thank you, I have used the following to get the required results:

     <?php if(get_field('currentShows', $post->post_parent)) { ?>
    			       
    <?php while(has_sub_field('currentShows', $post->post_parent)): ?>
    				 
     <li><a href="<?php the_sub_field('currentLink'); ?>"><?php the_sub_field('currentLinkText'); ?></a></li>
    				   
    <?php endwhile; ?>
    	<?php }
    				
    	else {
    	echo 'Coming soon';
    	} ?>

    Thanks