From 5ad7219b03b14b5d12721a7ba6c77c41d737007a Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Fri, 3 Nov 2017 17:38:38 +1100 Subject: [PATCH] Add SportsEvent microdata to event blocks --- includes/sp-core-functions.php | 2 +- templates/event-blocks.php | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php index d53bc89a..200977cf 100644 --- a/includes/sp-core-functions.php +++ b/includes/sp-core-functions.php @@ -228,7 +228,7 @@ if ( !function_exists( 'sp_flush_rewrite_rules' ) ) { if ( !function_exists( 'sp_add_link' ) ) { function sp_add_link( $string, $link = false, $active = true ) { if ( empty( $link ) || ! $active ) return $string; - return '' . $string . ''; + return ''; } } diff --git a/templates/event-blocks.php b/templates/event-blocks.php index 887aad01..5c5a12d1 100644 --- a/templates/event-blocks.php +++ b/templates/event-blocks.php @@ -105,14 +105,21 @@ if ( $title ) $j = 0; foreach( $teams as $team ): $j++; + $team_name = get_the_title( $team ); if ( has_post_thumbnail ( $team ) ): + $logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'itemprop' => 'logo' ) ); + if ( $link_teams ): - $logo = ''; - else: - $logo = ''; + $team_permalink = get_permalink( $team, false, true ); + $logo = ''; endif; - $logos[] = $logo; + + $logo = ''; + else: + $logo = ''; endif; + + $logos[] = $logo; endforeach; endif; @@ -124,10 +131,10 @@ if ( $title ) endif; endif; ?> - + -