Check if teams exist in countdown
This commit is contained in:
@@ -46,13 +46,15 @@ if ( $link_events ) $title = '<a href="' . get_post_permalink( $post->ID, false,
|
|||||||
$teams = array_unique( get_post_meta( $post->ID, 'sp_team' ) );
|
$teams = array_unique( get_post_meta( $post->ID, 'sp_team' ) );
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
foreach ( $teams as $team ) {
|
if ( is_array( $teams ) ) {
|
||||||
$i++;
|
foreach ( $teams as $team ) {
|
||||||
if ( has_post_thumbnail ( $team ) ) {
|
$i++;
|
||||||
if ( $link_teams ) {
|
if ( has_post_thumbnail ( $team ) ) {
|
||||||
echo '<a class="team-logo logo-' . ( $i % 2 ? 'odd' : 'even' ) . '" href="' . get_post_permalink( $team ) . '" title="' . get_the_title( $team ) . '">' . get_the_post_thumbnail( $team, 'sportspress-fit-icon' ) . '</a>';
|
if ( $link_teams ) {
|
||||||
} else {
|
echo '<a class="team-logo logo-' . ( $i % 2 ? 'odd' : 'even' ) . '" href="' . get_post_permalink( $team ) . '" title="' . get_the_title( $team ) . '">' . get_the_post_thumbnail( $team, 'sportspress-fit-icon' ) . '</a>';
|
||||||
echo get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $i % 2 ? 'odd' : 'even' ) ) );
|
} else {
|
||||||
|
echo get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $i % 2 ? 'odd' : 'even' ) ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user