Skip to content

Instantly share code, notes, and snippets.

@t0t
Created September 8, 2014 15:28
Show Gist options
  • Save t0t/c04c2515713c2f21f410 to your computer and use it in GitHub Desktop.
Save t0t/c04c2515713c2f21f410 to your computer and use it in GitHub Desktop.
"Post Object" only showing post ID's
http://t0theme.sergiofores.net/pagina-ejemplo/
<?php elseif(get_row_layout() == "posts_carrousel"): //Layout Carrusel ?>
<div class="row">
<h3 class="h1"><?php the_sub_field("title"); ?></h3>
<h3><?php the_sub_field("description"); ?></h3>
<?php if(get_sub_field("repeater")): ?>
<?php while(has_sub_field("repeater")): ?>
<?php $post_objects = the_sub_field('post_item');
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('post_item', $post_object->ID); ?></span>
</li>
<?php endforeach; ?>
</ul>
<?php endif;?>
<?php endwhile; ?>
<?php endif; ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment