-
-
Save hiiightower/dc9498e6cc2336350d64e4188704dafe to your computer and use it in GitHub Desktop.
ACF: Get Post Object data within a Repeater
This file contains hidden or 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
<section class="slider"> | |
<?php if( have_rows('slides') ): ?> | |
<div id="slider" class="flexslider"> | |
<ul class="slides"> | |
<?php while ( have_rows('slides') ) : the_row(); ?> | |
<li> | |
<?php $post_object = get_sub_field('featured_projects'); ?> | |
<?php if( $post_object ): ?> | |
<?php $post = $post_object; setup_postdata( $post ); ?> | |
<a href="<?php the_permalink(); ?>"><img src="<?php the_field('featured_image'); ?>" alt="<?php the_title(); ?>" /></a> | |
<?php wp_reset_postdata(); ?> | |
<?php endif; ?> | |
</li> | |
<?php endwhile; ?> | |
</ul> | |
</div> | |
<?php endif; ?> | |
</section> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment