Created
January 29, 2016 14:10
-
-
Save bratsun/8449b55c9e10fcd3b48a to your computer and use it in GitHub Desktop.
Loop through post objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$post_objects = get_field('post_objects'); | |
if( $post_objects ): ?> | |
<ul> | |
<?php foreach( $post_objects as $post_object): ?> | |
<li> | |
<a href="<?php echo get_permalink($post_object->ID); ?>"><?php echo get_the_title($post_object->ID); ?></a> | |
<span>Post Object Custom Field: <?php the_field('field_name', $post_object->ID); ?></span> | |
</li> | |
<?php endforeach; ?> | |
</ul> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment