• Resolved sgnzuk

    (@sgnzuk)


    Hey,

    Amazing plugin! This is exactly what i’m after.

    I’m just wondering if you can help with something. I’m having problems displaying my relationship field data.

    I’m using the below to pull it in:

    [ajax_load_more preloaded='true' preloaded_amount='1' repeater='template_29' post_type='newexhibitions' posts_per_page='1' orderby='post__in' pause='true' pause_override='true' button_loading_label='Loading...' acf='true' acf_field_type='relationship' acf_field_name='featured_works']

    and in the repeater template:

    <div class="row">
                                    <div class="item col <?php echo (++$count % 2) ? 'col col-g-6 col-md-6 col-sm-10 col-xs-10 left' : 'col col-lg-offset-6 col-lg-6 col-md-offset-6 col-md-6 col-sm-offset-2 col-sm-10 col-xs-offset-2 col-xs-10 right' ?>">
                                             <div class="image"><a href="<?php the_permalink(); ?>"><img src="<?php the_field('square_thumbnail_image'); ?>" class="lazy"  /></a></div>
                                            <div class="text">
                                                <a href="<?php the_permalink(); ?>"><h3><?php the_title(); ?></h3></a>
                                                <h4><?php the_field('works-year'); ?></h4>
                                                <a href="<?php the_permalink(); ?>"><strong class="std-button"><span>More Information</span></strong></a>
                                            </div>
                                    </div>
                                </div>

    This seems to be working, however it’s loading the posts within the Custom Post Type newexhibitions rather than the related content in the featured_works field.

    Just to confirm, I have the ACF extension installed.

    Any ideas would be greatly appreciated ??

    Thanks!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘ACF Relationship – Loading CPT data not Relationship data’ is closed to new replies.