I have fixed all the code and I think it should work. I can pull in all of the results, but can’t narrow it down to just the athlete that is on the profile page. Here is the new code.
<?php
$athlete = wp_title( '', false);
$args = array(
'post_type' => 'result',
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => 15,
'paged' => $paged,
'meta_query' => array(
array(
'meta_key' => 'result-athlete',
'meta_value' => $athlete,
'compare' => '='
)
)
);
$the_query = new WP_Query( $args );
?>
<div class="col-md-12 index-results-Section">
<?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="index-resultsSingle">
<div class="col-md-2 index-resultsAthlete">
<?php the_field( 'result-athlete' ); ?>
</div><!-- .index-resultsAthlete -->
<div class="col-md-7 index-resultsSport">
<?php the_field( 'result-sport' ); ?>
<?php the_field( 'result-date' ); ?>
</div> <!-- .index-resultsSport -->
<div class="col-md-3 index-resultsResult">
<?php the_field( 'result-result' ); ?>
</div> <!-- .index-resultsResult -->
<div class="clearfix"></div>
</div>
<?php endwhile; endif; ?>
<div class="clearfix visible-sm"></div>
</div>
If anyone can’t see where I am going wrong I would greatly appreciate it.