Drinkbaar
Forum Replies Created
-
Wauw, your solution works like a charm! Really nice and thank you. At this very moment I’m editing the player_list layout as well and it gives me headaches!
/Youri
Good morning everyone. First of all, this plugin is amazing and my question is regarding the countdown page. I edited the file, but it’s not showing the venue. Can someone look at the code and see what I’m doing wrong? Thank you.
———————-
if ( ! defined( ‘ABSPATH’ ) ) exit; // Exit if accessed directly
$defaults = array(
‘team’ => null,
‘id’ => null,
‘live’ => get_option( ‘sportspress_enable_live_countdowns’, ‘yes’ ) == ‘yes’ ? true : false,
);if ( isset( $id ) ):
$post = get_post( $id );
else:
$args = array();
if ( isset( $team ) )
$args = array( array( ‘key’ => ‘sp_team’, ‘value’ => $team ) );
$post = sp_get_next_event( $args );
endif;extract( $defaults, EXTR_SKIP );
if ( ! isset( $post ) ) return;
$id = $post->ID;
$teams = get_post_meta( $id, ‘sp_team’ );?>
<div class=”upcoming-match-item-wrapper gdlr-item” style=”margin-bottom: 0px;”>
<div class=”upcoming-match-overlay”></div>
<div class=”gdlr-upcoming-match-team-wrapper”>
<span class=”gdlr-upcoming-match-team gdlr-left”><?php echo get_the_title( $teams[0] ); ?></span>
<span class=”gdlr-upcoming-match-versus”>VS</span>
<span class=”gdlr-upcoming-match-team gdlr-right”><?php echo get_the_title( $teams[1] ); ?></span>
</div>
<span class=”match-result-info-wrapper”>
<span class=”upcoming-match-info-overlay”></span>
<span class=”match-result-info”>
<i class=”icon-location-arrow”></i>
<?php
if ( isset( $show_venue ) && $show_venue ):
$venues = get_the_terms( $post->ID, ‘sp_venue’ );
if ( $venues ):
echo the_terms( $post->ID, ‘sp_venue’ );
endif;
endif;if ( isset( $show_league ) && $show_league ):
$leagues = get_the_terms( $post->ID, ‘sp_league’ );
if ( $leagues ):
foreach( $leagues as $league ):
$term = get_term( $league->term_id, ‘sp_league’ );
echo $term->name;
endforeach;
endif;
endif; ?>
</span>
<span class=”match-result-info”>
<i class=”icon-calendar”></i><?php $now = new DateTime( current_time( ‘mysql’, 0 ) ); $date = new DateTime( $post->post_date );
$interval = date_diff( $now, $date );$days = $interval->invert ? 0 : $interval->days;
$h = $interval->invert ? 0 : $interval->h;
$i = $interval->invert ? 0 : $interval->i;
$s = $interval->invert ? 0 : $interval->s;
?><time datetime=”<?php echo $post->post_date; ?>”<?php if ( $live ): ?> data-countdown=”<?php echo str_replace( ‘-‘, ‘/’, $post->post_date ); ?>”<?php endif; ?>><?php echo sprintf( ‘%02s’, $days ); ?> <small><?php _e( ‘days’, ‘sportspress’ ); ?></small><?php echo sprintf( ‘%02s’, $h ); ?> <small><?php _e( ‘hrs’, ‘sportspress’ ); ?></small><?php echo sprintf( ‘%02s’, $i ); ?> <small><?php _e( ‘mins’, ‘sportspress’ ); ?></small><?php echo sprintf( ‘%02s’, $s ); ?> <small><?php _e( ‘secs’, ‘sportspress’ ); ?></small></time></span>
</span>
</div>