Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- Template Name: Test
- */
- get_header(); ?>
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
- <div id="main" role="main" class="clearfix">
- <?php if ( function_exists('yoast_breadcrumb') ) {
- yoast_breadcrumb('<p id="breadcrumbs">','</p>');
- } ?>
- <h1><?php the_field('team_name'); ?></h1>
- <div class="left-content">
- <?php if(has_post_thumbnail()) { ?>
- <div class="banner">
- <?php the_post_thumbnail('large'); ?>
- </div>
- <?php } ?>
- </div>
- <div class="right-content">
- <h2>Practice Schedule</h2>
- <?php the_field('practice_schedule'); ?>
- <!--! tournament section -->
- <section class="tournaments">
- <h2>Tournament Schedule</h2>
- <?php
- $tournaments = get_field( 'tournament_selection' );
- if( $tournaments ) {
- $upcoming = '';
- $finished = '';
- foreach( $tournaments as $tournament ) {
- $terms = wp_get_object_terms( $tournament, array('orderby' => 'name', 'order' => 'ASC', 'fields' => 'slug') );
- if( in_array( 'upcoming-tournament', $terms ) ) {
- $upcoming .= 'Upcoming!'
- }
- if( in_array( 'finished-tournament', $terms ) ) {
- $finished .= 'Finished!'
- }
- }
- ?>
- <h3>Upcoming Tournaments</h3>
- <?php echo $upcoming; ?>
- <h3>Finished Tournaments</h3>
- <?php echo $finished; ?>
- <?php
- }
- ?>
- </section>
- <?php the_content(); ?>
- </div>
- <hr />
- <!--! player roster -->
- <div class="left-content">
- <h2>Player Roster</h2>
- <div class="player">
- <table>
- <thead>
- <tr>
- <th class="player-name">Player's Name</th>
- <th>#</th>
- <th>Pos.</th>
- <th>Height</th>
- <th>Reach</th>
- <th>Jump</th>
- <th>Vertical</th>
- <th>Grade</th>
- </tr>
- </thead>
- <?php $player_query = new WP_Query( 'post_type=players&category_name=13-1-elite&orderby=title&order=ASC' );
- while ( $player_query->have_posts() ) : $player_query->the_post(); ?>
- <tr>
- <td class="player-name"><a href="<?php the_permalink(); ?>" title="Player's Bio"><?php the_title(); ?></a></td>
- <td><?php the_field("jersey_number"); ?></td>
- <td><?php the_field("position"); ?></td>
- <td><?php the_field("height_feet"); ?>'<?php the_field("height_inches"); ?>"</td>
- <td><?php the_field("reach_feet"); ?>'<?php the_field("reach_inches"); ?>"</td>
- <td><?php the_field("jump_touch_feet"); ?>'<?php the_field("jump_touch_inches"); ?>"</td>
- <td><?php the_field("vertical"); ?>"</td>
- <td><?php the_field("current_grade"); ?></td>
- </tr>
- <?php endwhile; wp_reset_postdata(); ?>
- </table>
- </div>
- </div>
- <!--! coaches roster -->
- <div class="right-content">
- <h2>Coaches</h2>
- <p><strong>Head Coach(es):</strong>
- <br />
- <?php $posts = get_field('head_coach');
- if( $posts ): ?>
- <?php foreach( $posts as $post_object): ?>
- <a href="<?php echo get_permalink($post_object->ID); ?>"><?php echo get_the_title($post_object->ID); ?></a>
- <?php endforeach; ?>
- <?php else : ?>
- <p>There are not any head coaches for this team</p>
- <?php endif; ?></p>
- <p><strong>Assistant Coach(es):</strong>
- <br />
- <?php $posts = get_field('assistant_coach');
- if( $posts ): ?>
- <?php foreach( $posts as $post_object): ?>
- <a href="<?php echo get_permalink($post_object->ID); ?>"><?php echo get_the_title($post_object->ID); ?></a>
- <?php endforeach; ?>
- <?php else : ?>
- <p>There are not any assistant coaches for this team</p>
- <?php endif; ?></p>
- </div>
- <?php endwhile; endif; ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement