Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author K

    (@koelle)

    The code would be correct? What shortcode are you using? [matches] or [match]? Add <?php var_dump($league); ?> and post the output.

    Thread Starter lerrie

    (@lerrie)

    Hi,

    Thanks for your reply. I am using the following shortcode:
    [matches league_id=all match_day=1 template=programma]

    I want to show the league name to which the match belongs to. I’ve added the var_cump, but it shows nothing. This is the code I use for the programma template:

    <?php if (isset($_GET['match_'.$league->id]) ) : ?>
    	<?php leaguemanager_match(intval($_GET['match_'.$league->id])); ?>
    <?php else : ?>
    
    <?php if ( $matches ) : ?>
    <table class='leaguemanager matchtable' summary='' title='<?php echo __( 'Match Plan', 'leaguemanager' )." ".$league->title ?>'>
    <tr>
    	<th class='match'><?php _e( 'Tijd', 'leaguemanager' ) ?></th>
    	<th class='match2'><?php _e( 'Wedstrijd', 'leaguemanager' ) ?></th>
    	<th class='match'><?php _e( 'Groep', 'leaguemanager' ) ?></th>
    	<th class='match'><?php _e( 'Veld', 'leaguemanager' ) ?></th>
    	<th class='match'><?php _e( 'Uitslag', 'leaguemanager' ) ?></th>
    </tr>
    <?php foreach ( $matches AS $match ) : ?>
    
    <tr class='<?php echo $match->class ?>'>
    	<td class='num' style="padding: 5px!important;"><?php echo $match->start_time ?></td>
    	<td class='num2' style="padding: 5px!important;"><a href="<?php echo $match->pageURL ?>"><?php echo $leaguemanager->getMatchTitle($match->id) ?></a></td>
        <td class='num' style="padding: 5px!important;"><?php echo $league->title ?><?php var_dump($league); ?></td>
    	<td class='num' style="padding: 5px!important;"><?php echo $match->location ?></td>
    	<td class='num' style="padding: 5px!important;"><?php echo $match->score ?></td>
    </tr>
    
    <?php endforeach; ?>
    </table>
    
    <?php endif; ?>
    
    <?php endif; ?>
    Thread Starter lerrie

    (@lerrie)

    I see the problem lays in the “league_id=all” parameter of the shortcode. Whenever I change this to a specific ID number it shows the name of the league. How can I still get this to work for league_Id=all?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display name/title of league does not work’ is closed to new replies.