Home Forums ACF PRO Post Objects and Repeater field


Post Objects and Repeater field

  • Hi
    I am having trouble retrieving a Post Object from a Repeater field inside a Post Object.
    Ticket (Custom post type) > Event (Post Object) > Performers (Repeater Field) > Artist (Post Object)

    I have manage to get the Artist (Post Object) to display from the Performers (Repeater Field), but I am struggling to see a way of wrapping that in the code for a Post Object.

    This is the code if have used:

    <?php $ticket = array( 
    		 'posts_per_page'=> -1					    
    	$ticketloop = new WP_Query( $ticket );
    	while ( $ticketloop->have_posts() ) : $ticketloop->the_post(); 
    	if( have_rows('performer') ): while ( have_rows('performer') ) :  the_row();
    		$post_object = get_sub_field('the_performer');
    		if ($post_object) { ?>
    			<a href="<?php echo get_the_permalink($post_object->ID); ?>" title=" <?php echo get_the_title($post_object->ID); ?>">
    				<?php echo get_the_title($post_object->ID); ?>
    		<?php } ?>
    	<?php endwhile; endif;

    I am unsure where to even begin on making this code as though it is within a Post Object.

    Any help or advice where to begin or look would be very much appreciated

Viewing 1 post (of 1 total)

The topic ‘Post Objects and Repeater field’ is closed to new replies.