Home › Forums › General Issues › Getting the_content() in a Relationship loop › Reply To: Getting the_content() in a Relationship loop
Bumping this – have the same issue.
I get the featured image, title and other acf fields, but no excerpt or content.
<h3>Course Faculty</h3>
<?php
global $post;
$faculty = get_field('alt_faculty');
if( $faculty ): ?>
<?php foreach( $faculty as $post): ?>
<?php setup_postdata($post); ?>
<div class="post-author">
<div class="thumb">
<?php if ( has_post_thumbnail() ) { ?>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
<?php } else { ?>
<a href="<?php the_permalink(); ?>"><img src="<?php echo catch_that_image(); ?>" /></a><?php }?>
</div>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php the_excerpt(); ?>
<?php get_template_part( 'partials/profile-social', '' ); ?>
</div>
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.