I have created a custom field called "team member" with different labels to develop 7 different team member pages.
However, when I click on each of the member, they take me to a blank page with just header and footer. Looks like they are using the template single_Post.php. How can I point the custom fields to a custom php template in the wordpress so that I can have one team member per page whenever I fill up the Team custom field in the back end.
<?php /* Template Name: Team */
get_header();
the_post();
$team_posts = get_posts( array(
'post_type' => 'team',
'posts_per_page' => 1, // Unlimited posts
) );
if ($team_posts):
?>
<div id="TeamBanner">
<?php
foreach($team_posts as $post):
setup_postdata($post);
$image = get_field('banner_image');
if( !empty($image) ):
?>
<img src= "<?php echo $image['url'];?>" alt="<?php echo $image['alt']; ?>"/>
<div id="innerbannerText" style="width:100%;">
<h1><?php the_field('member_name'); ?></h1>
<h3>
<i><?php the_field('member_subheading'); ?></i>
</h3>
<p> <span> <?php the_field('team_content'); ?> </span> </p>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>