In this example:
Ajax Load More will load a featured set of posts using the Relationship field for Advanced Custom Fields and the ACF extension.

The Relationship field for Advanced Custom Fields allows you to select from pages, posts and custom post types to build an array of related content – Ajax Load More is used to loop over related item and display the results with infinite scrolling.

NOTE: When using the Relationship field remember to set orderby=”post__in” in your shortcode and select Post ID as the return type when creating your field in ACF – see this screenshot.


The following shortcode was used to create the Relationship Field example.

[ajax_load_more preloaded="true" preloaded_amount="2" post_type="ajax_more" posts_per_page="4" orderby="post__in" acf="true" acf_field_type="relationship" acf_field_name="alm_featured_posts"]

Note: In this example, alm_featured_posts is the name of the Relationship ACF Field Group. Ajax Load More will loop over each post item in this Relationship Content field to build the infinite scroll listing.

The following Repeater Template was used to create the Relationship Field example.