Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author lepileppanen

    (@lepileppanen)

    This is quite easy to do by yourself.

    Copy all the code in single-tss-seasons.php.

    Create a new file in your themes-folder and paste the code in there and name the template like you want it. Then replace $post->ID with season id that you want to request.

    Example code for to show season matches from season id 3. Save that and set it to page template in some of your pages.

    <?php
    /**
     * Template name: Only matches
     *
     */
    
    get_header();
    
    ?>
    
    <div class="bootstrap-wrapper">
      <div class="<?php echo tss_get_container() ?>">
        <div class="row">
          <div class="col-sm-12">
            <h1>Just some title here...</h1>
          </div>
        </div>
    
    		<?php
    		$json = tss_get_matches_in_season(3);
    		$data = json_decode( $json );
    		?>
    		<div class="row">
          <div class="col-sm-12">
            <h2><?php echo esc_html__( 'Matches', 'tss' ) ?></h2>
    				<table class="table">
              <thead>
                <tr>
                  <th><?php echo esc_html__( 'Date', 'tss' ) ?></th>
                  <th class="text-center"><?php echo esc_html__( 'Hometeam', 'tss' ) ?></th>
                  <th class="text-center"><?php echo esc_html__( 'Awayteam', 'tss' ) ?></th>
                  <th class="text-center"><?php echo esc_html__( 'Matchtype', 'tss' ) ?></th>
                  <th class="text-center"><?php echo esc_html__( 'Result', 'tss' ) ?></th>
                </tr>
              </thead>
              <tbody>
                <?php
    						foreach ($data as $match) {
    							?>
    							<tr>
    								<td><?php echo esc_html( $match->date ) ?></td>
    	              <td class="text-center"><?php echo e_team_with_link( $match->hometeam, $match->{'opponent-id'} ) ?></td>
    	              <td class="text-center"><?php echo e_team_with_link( $match->awayteam, $match->{'opponent-id'} ) ?></td>
    	              <td class="text-center"><?php echo esc_html( tss_e_matchtype( $match->matchtype, $match->{'additional-matchtype'} ) ) ?></td>
    	              <td class="text-center"><a href="<?php echo esc_url( get_permalink( $match->id ) ) ?>"><?php echo esc_html( tss_get_result_string( $match->penalties, $match->overtime, $match->homegoals, $match->awaygoals, $match->homegoalspen, $match->awaygoalspen  ) ) ?></a></td>
    							</tr>
    							<?php
    						}
    						?>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
    
    <?php
    get_footer();
    ?>
    Plugin Author lepileppanen

    (@lepileppanen)

    –> resolved

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Is it possible to show list of matches for a season?’ is closed to new replies.