Title: Custom matchtable
Last modified: August 22, 2016

---

# Custom matchtable

 *  [jnko](https://wordpress.org/support/users/kopr/)
 * (@kopr)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/)
 * Hi Kolja, Please check my small code modifications in matches.php.
    It is usable?
   There is something that would be conflicting laeguemanager? I’m not a programmer
   prefer to ask. Thank you very much for checking. The result of adjustments see
   the. picture [http://jnko.eu/wp-content/uploads/matches.png](http://jnko.eu/wp-content/uploads/matches.png)
 *     ```
       <table class='leaguemanager matchtable' summary='' title='<?php echo __( 'Match Plan', 'leaguemanager' )." ".$league->title ?>'>
       <tr>
       	<th class='match'><?php _e( 'Match', 'leaguemanager' ) ?></th>
       	<th class='score'><?php _e( 'Score', 'leaguemanager' ) ?></th>
       	<th class='match'><?php _e( 'Match', 'leaguemanager' ) ?></th>
       </tr>
       <?php foreach ( $matches AS $match ) : ?>
                    <?php $The_Home_team = "<br class='logos'><img class='home_logo' src='".$teams[$match->home_team]['logo']."' alt='' /></br>".$The_Home_team = $teams[$match->home_team]['title']; ?>
       			 <?php $The_Away_team = "<br class='logos'><img class='away_logo' src='".$teams[$match->away_team]['logo']."' alt='' /></br>".$The_Away_team = $teams[$match->away_team]['title']; ?>
                     <?php if ( $leaguemanager->isHomeTeamMatch( $match->home_team, $match->away_team, $teams ) ) : ?>
           	      <?php endif; ?>
   
       			  <tr class='<?php echo $match->class ?>'>
                     <td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Home_team ?> </td>
       			  <td class='match' style='text-align:center; margin: 20px; font-size: 20px;'><?php echo $match->homeScore."-".$match->awayScore  ?><br /><?php echo '<p style="font-size: 12px; font-style: italic;">'.$match->date." ".$match->start_time.'</p>' ?> </td>
                     <td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Away_team ?></td>
       		</tr>
       <?php endforeach; ?>
       </table>
       ```
   
 * [https://wordpress.org/plugins/leaguemanager/](https://wordpress.org/plugins/leaguemanager/)

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

 *  Plugin Author [K](https://wordpress.org/support/users/koelle/)
 * (@koelle)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773334)
 * Hi jinko, nice job, I only fixed the code a little bit.
 *     ```
       <table class='leaguemanager matchtable' summary='' title='<?php echo __( 'Match Plan', 'leaguemanager' )." ".$league->title ?>'>
       <tr>
               <th class='match'><?php _e( 'Home Team', 'leaguemanager' ) ?></th>
       	<th class='score'><?php _e( 'Score', 'leaguemanager' ) ?></th>
       	<th class='match'><?php _e( 'Away Team', 'leaguemanager' ) ?></th>
       </tr>
       <?php foreach ( $matches AS $match ) : ?>
          <?php $The_Home_team = "<span class='logos'><img class='home_logo' src='".$teams[$match->home_team]['logo']."' alt='' /></span>".$teams[$match->home_team]['title']; ?>
          <?php $The_Away_team = "<span class='logos'><img class='away_logo' src='".$teams[$match->away_team]['logo']."' alt='' /></span>".$teams[$match->away_team]['title']; ?>
          <?php if ( $leaguemanager->isHomeTeamMatch( $match->home_team, $match->away_team, $teams ) ) : ?>
            $The_Home_team = sprintf("<strong>%s</strong>", $The_Home_team);
            $The_Away_team = sprintf("<strong>%s</strong>", $The_Away_team);
          <?php endif; ?>
          <tr class='<?php echo $match->class ?>'>
            <td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Home_team ?> </td>
            <td class='match' style='text-align:center; margin: 20px; font-size: 20px;'><?php echo $match->homeScore."-".$match->awayScore  ?><br /><?php echo '<p style="font-size: 12px; font-style: italic;">'.$match->date." ".$match->start_time.'</p>' ?> </td>
            <td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Away_team ?></td>
          </tr>
       <?php endforeach; ?>
       </table>
       ```
   
 *  Thread Starter [jnko](https://wordpress.org/support/users/kopr/)
 * (@kopr)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773348)
 * Thank you, your modified code throws me an error, but I figured it was probably
   from you test for me:-)
    `<?php $The_Home_team = sprintf("<strong>%s</strong>",
   $The_Home_team);?>`
 * In my template tag nicer ‘br’ instead of ‘span’
    thank you very much sorry for
   bad English Final code:
 *     ```
       <table class='leaguemanager matchtable' summary='' title='<?php echo __( 'Match Plan', 'leaguemanager' )." ".$league->title ?>'>
       <tr>
           <th class='match'><?php _e( 'Home Team', 'leaguemanager' ) ?></th>
           <th class='score'><?php _e( 'Score', 'leaguemanager' ) ?></th>
           <th class='match'><?php _e( 'Away Team', 'leaguemanager' ) ?></th>
       </tr>
       <?php foreach ( $matches AS $match ) : ?>
          <?php $The_Home_team = "<br class='logos'><img class='home_logo' src='".$teams[$match->home_team]['logo']."' alt='' /></br>".$teams[$match->home_team]['title']; ?>
          <?php $The_Away_team = "<br class='logos'><img class='away_logo' src='".$teams[$match->away_team]['logo']."' alt='' /></br>".$teams[$match->away_team]['title']; ?>
          <?php if ( $leaguemanager->isHomeTeamMatch( $match->home_team, $match->away_team, $teams ) ) : ?>
          <?php $The_Home_team = sprintf("<strong>%s</strong>", $The_Home_team);?>
          <?php $The_Away_team = sprintf("<strong>%s</strong>", $The_Away_team); ?>
          <?php endif; ?>
          <tr class='<?php echo $match->class ?>'>
            <td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Home_team ?> </td>
            <td class='match' style='text-align:center; padding-top: 35px; font-size: 20px; font-weight: bold;'><?php echo $match->homeScore."-".$match->awayScore  ?><br /><?php echo '<p style="font-size: 12px; font-weight: normal; font-style: italic;">'.$match->date." ".$match->start_time.'</p>' ?> </td>
            <td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Away_team ?></td>
          </tr>
       <?php endforeach; ?>
       </table>
       ```
   
 *  Thread Starter [jnko](https://wordpress.org/support/users/kopr/)
 * (@kopr)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773355)
 * One more question Kolja,
    I do not know whether it’s just me, but playing on 
   the filter does not work. [http://jnko.eu/wp-content/uploads/filter.png](http://jnko.eu/wp-content/uploads/filter.png)
 *  [Matija](https://wordpress.org/support/users/matija385/)
 * (@matija385)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773430)
 * hi, this is great, i hope kolja will include this in next plugin update.
 * Question – is it possible (and how) to have both “templates” for matches? For
   example, on one page i want to have this, let’s call it, fancy template, but 
   on the other page, ia want to have just results of all matches in league?
 * Thank you,
 * KR,
    Matija
 *  [armando.alberti](https://wordpress.org/support/users/armandoalberti/)
 * (@armandoalberti)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773451)
 * this piece of code sounds familiar 🙂
 *  [Ljubi_sa](https://wordpress.org/support/users/ljubi_sa/)
 * (@ljubi_sa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773454)
 * nice job jnko. THX
 *  Plugin Author [K](https://wordpress.org/support/users/koelle/)
 * (@koelle)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773461)
 * Hi Jinko, your usage of `<br>` is simply wrong! It only forces a line break. 
   This could do what you want.
 *     ```
       <table class='leaguemanager matchtable' summary='' title='<?php echo __( 'Match Plan', 'leaguemanager' )." ".$league->title ?>'>
       <tr>
           <th class='match'><?php _e( 'Home Team', 'leaguemanager' ) ?></th>
           <th class='score'><?php _e( 'Score', 'leaguemanager' ) ?></th>
           <th class='match'><?php _e( 'Away Team', 'leaguemanager' ) ?></th>
       </tr>
       <?php foreach ( $matches AS $match ) : ?>
          <?php $The_Home_team = $teams[$match->home_team]['title']; ?>
          <?php $The_Away_team = $teams[$match->away_team]['title'] ?>
          <?php if ( $leaguemanager->isHomeTeamMatch( $match->home_team, $match->away_team, $teams ) ) : ?>
          <?php $The_Home_team = sprintf("<strong>%s</strong>", $The_Home_team);?>
          <?php $The_Away_team = sprintf("<strong>%s</strong>", $The_Away_team); ?>
          <?php endif; ?>
   
          <?php $The_Home_team = "<p class='logos'><img class='home_logo' src='".$teams[$match->home_team]['logo']."' alt='' /></p><p>".$The_Home_team."</p>"; ?>
          <?php $The_Away_team = "<p class='logos'><img class='away_logo' src='".$teams[$match->away_team]['logo']."' alt='' /></p><p>".$The_Away_team."</p>"; ?>
   
          <tr class='<?php echo $match->class ?>'>
            <td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Home_team ?> </td>
            <td class='match' style='text-align:center; padding-top: 35px; font-size: 20px; font-weight: bold;'><?php echo $match->homeScore."-".$match->awayScore  ?><br /><?php echo '<p style="font-size: 12px; font-weight: normal; font-style: italic;">'.$match->date." ".$match->start_time.'</p>' ?> </td>
            <td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Away_team ?></td>
          </tr>
       <?php endforeach; ?>
       </table>
       ```
   
 *  [ben52](https://wordpress.org/support/users/ben52/)
 * (@ben52)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773464)
 * better that you remove summary=”” from all tables – it is not allowed any more.
 *  Thread Starter [jnko](https://wordpress.org/support/users/kopr/)
 * (@kopr)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773470)
 * Hello to all.
    **For-Kolja** Thank you for the explanation.
 * **For-ben52**
    I’m not a programmer, I tried your suggestion to delete summary
   = “”, but somehow I did not. I will be happy if you help us clean up the code.
 * **For-armando.alberti**
    I waited if you continue and put in the code and logos,
   as I interviewed a proposal from Kolji’re applying for a change “homeScore”. 
   When nothing happened for a long time, so I finished it, perhaps you do not mind:-)
 * For all
    It works well you filter playing days? On my template does not respond.
   [http://jnko.eu/wp-content/uploads/filter.png&#8221](http://jnko.eu/wp-content/uploads/filter.png&#8221);
 *  [ben52](https://wordpress.org/support/users/ben52/)
 * (@ben52)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773512)
 * Hi jnko,
    example:
 * <table class=’leaguemanager matchtable’ summary=” title='<?php echo __( ‘Match
   Plan’, ‘leaguemanager’ ).” “.$league->title ?>’>
 * you have to remove “summary=”” will be like this:
 * <table class=’leaguemanager matchtable’ title='<?php echo __( ‘Match Plan’, ‘
   leaguemanager’ ).” “.$league->title ?>’>
 *  Thread Starter [jnko](https://wordpress.org/support/users/kopr/)
 * (@kopr)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773523)
 * Hi ben52,
    Thank you very much for the correction. I got it wrong.
 *  [armando.alberti](https://wordpress.org/support/users/armandoalberti/)
 * (@armandoalberti)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773581)
 * Kolja,
    I am sure many of us are producing interesting custom templates for showing
   standings matches etc etc. Why don’t we create a kinda “LeagueManager Best Practice
   Forum” somewhere in Internet to let anyone sharing pieces of codes? I am sure
   plug-in will take-off further….
 * Thanks
 *  Thread Starter [jnko](https://wordpress.org/support/users/kopr/)
 * (@kopr)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773606)
 * Hi, I also was a separate forum. I would like to join and even helped create 
   some simple forum.

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

The topic ‘Custom matchtable’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/leaguemanager.svg)
 * [LeagueManager](https://wordpress.org/plugins/leaguemanager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/leaguemanager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/leaguemanager/)
 * [Active Topics](https://wordpress.org/support/plugin/leaguemanager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/leaguemanager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/leaguemanager/reviews/)

 * 13 replies
 * 6 participants
 * Last reply from: [jnko](https://wordpress.org/support/users/kopr/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/custom-matchtable/#post-5773606)
 * Status: not resolved