Title: Relationship Loop
Last modified: August 21, 2016

---

# Relationship Loop

 *  [klevimaska](https://wordpress.org/support/users/klevimaska/)
 * (@klevimaska)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/relationship-loop/)
 * I have created the realationship field with ACF and i want just to show the first
   post i have chose it and then 2 other on the next page and the the rest. I have
   make it before with query offset=1 offset=3 but with ACF i donw knot how to do
   it.
 * Thank you
 * My code:
 *     ```
       <?php foreach( $posts as $post): ?>
       							<div id="lajme-bllok-item-vogel">
       								<?php $prop_slider = get_field('id_slider');
       									if( $prop_slider != '' ){
       									echo do_shortcode("[metaslider id=".$prop_slider."]");
       									} else { ?>
       									<a href="<?php the_permalink($post->ID); ?>"><?php the_post_thumbnail($post_id, 'lajmet-thumb'); ?></a>
       									<?php } ?>
                                       <div id="lajme-bllok-item-title-vogel"><a href="<?php echo the_permalink($post->ID); ?>"><?php the_title($post->ID); ?></a>
       									<?php $prop_det_url_foto = get_field('link_foto'); if( $prop_det_url_foto != '' ){ ?><a class="linkfoto" href="<?php echo $prop_det_url_foto;?>">Foto</a><?php } ?>
       									<?php $prop_det_url_video = get_field('link_video'); if( $prop_det_url_video != '' ){ ?>- <a class="linkvideo" href="<?php echo $prop_det_url_video;?>">Video</a><?php } ?>
       								<div id="top-news-title-linku-posht">
       									<?php $prop_det_url_pershkrim = get_field('link_pershkrimi'); if( $prop_det_url_pershkrim != '' ){ ?><?php echo $prop_det_url_pershkrim;?><?php } ?></div>
       								<div id="top-news-title-linku-posht"><?php for( $i=1; $i<=4; $i++){ $prop_det_url = get_field('link'.$i); if( $prop_det_url != '' ){ ?>
       									<li><a href="<?php echo $prop_det_url; ?>" target="_blank"><?php the_field('link_titull'.$i); ?></a></li> <?php } } ?>
       								</div>
       								</div>
       								<div id="social-media-vogel">
       									<span class='st_facebook' st_image='<?php the_post_thumbnail('lajmet-thumb'); ?>' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>'></span>
       									<span st_via='@oranewsrtv' st_username='oranewsrtv' class='st_twitter' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>'></span>
       								<span class='st_googleplus' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>'></span>
       								<a style="float:right;" href="<?php the_permalink(); ?>#comment"><?php comments_number( 'Komento (0)', 'Komento (1)', 'Komento(%)' ); ?></a></div>
       								</div>
                               <?php endforeach; ?>
                           <?php endif; ?>
       ```
   
 * [https://wordpress.org/plugins/advanced-custom-fields/](https://wordpress.org/plugins/advanced-custom-fields/)

The topic ‘Relationship Loop’ is closed to new replies.

 * ![](https://ps.w.org/advanced-custom-fields/assets/icon.svg?rev=3207824)
 * [Advanced Custom Fields (ACF®)](https://wordpress.org/plugins/advanced-custom-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-custom-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-custom-fields/reviews/)

## Tags

 * [Relationship](https://wordpress.org/support/topic-tag/relationship/)

 * 0 replies
 * 1 participant
 * Last reply from: [klevimaska](https://wordpress.org/support/users/klevimaska/)
 * Last activity: [11 years, 12 months ago](https://wordpress.org/support/topic/relationship-loop/)
 * Status: not resolved