Home › Forums › Front-end Issues › get_the_title($post->ID) only shows outside my loop › Reply To: get_the_title($post->ID) only shows outside my loop
Looks like just a minor typo possibly. In your first <td>
you’ll need to echo
your values. Also, the permalink variable was not declared. Might try:
if( $posts ):
foreach( $posts as $post ):
$fww_title = get_the_title( $post->ID );
?>
<tr>
<td><a href="<?php echo get_permalink( $post->ID ); ?>"><?php echo $fww_title; ?></a></td>
<td>test</td>
<td><?php the_field('player_gender', $post->ID); ?></td>
<td><?php the_field('player_level', $post->ID); ?></td>
<td><?php the_field('player_city', $post->ID); ?>, <?php the_field('player_state', $post->ID); ?></td>
<td><?php the_field('player_phone', $post->ID); ?></td>
<td><?php the_field('player_email', $post->ID); ?></td>
</tr>
<?php endforeach; ?>
<?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.