diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php
index b716f382..c87d8814 100644
--- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php
+++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php
@@ -32,7 +32,7 @@ class SP_Meta_Box_Event_Teams {
'name' => 'sp_team[]',
'class' => 'sportspress-pages',
'show_option_none' => sprintf( __( '— None —', 'sportspress' ), 'Team' ),
- 'selected' => $team
+ 'selected' => $team,
);
wp_dropdown_pages( $args );
?>
diff --git a/includes/admin/settings/class-sp-settings-events.php b/includes/admin/settings/class-sp-settings-events.php
index ef7ca5e6..0b67894f 100644
--- a/includes/admin/settings/class-sp-settings-events.php
+++ b/includes/admin/settings/class-sp-settings-events.php
@@ -101,6 +101,14 @@ class SP_Settings_Events extends SP_Settings_Page {
array( 'title' => __( 'Calendars', 'sportspress' ), 'type' => 'title', 'id' => 'calendar_options' ),
+ array(
+ 'title' => __( 'Teams', 'sportspress' ),
+ 'desc' => __( 'Link teams', 'sportspress' ),
+ 'id' => 'sportspress_calendar_link_teams',
+ 'default' => 'no',
+ 'type' => 'checkbox',
+ ),
+
array(
'title' => __( 'Pagination', 'sportspress' ),
'desc' => __( 'Paginate', 'sportspress' ),
diff --git a/templates/event-blocks.php b/templates/event-blocks.php
index a458811b..b0ff8496 100644
--- a/templates/event-blocks.php
+++ b/templates/event-blocks.php
@@ -14,6 +14,7 @@ $primary_result = get_option( 'sportspress_primary_result', null );
$defaults = array(
'status' => 'default',
'number' => -1,
+ 'link_teams' => get_option( 'sportspress_calendar_link_teams', 'no' ) == 'yes' ? true : false,
'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false,
'rows' => get_option( 'sportspress_calendar_rows', 10 ),
'order' => 'default',
@@ -57,7 +58,11 @@ if ( isset( $columns ) )
if ( ! has_post_thumbnail ( $team ) )
continue;
$j++;
- $logo = '' . get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) ) . '';
+ if ( $link_teams ):
+ $logo = '' . get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) ) . '';
+ else:
+ $logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) );
+ endif;
$logos[] = $logo;
$team_results = sp_array_value( $results, $team, null );
diff --git a/templates/event-list.php b/templates/event-list.php
index c158cd20..e19519f1 100644
--- a/templates/event-list.php
+++ b/templates/event-list.php
@@ -14,6 +14,7 @@ $primary_result = get_option( 'sportspress_primary_result', null );
$defaults = array(
'status' => 'default',
'number' => -1,
+ 'link_teams' => get_option( 'sportspress_calendar_link_teams', 'no' ) == 'yes' ? true : false,
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false,
@@ -93,7 +94,11 @@ if ( isset( $columns ) )
endif;
endif;
- $teams_output .= $name;
+ if ( $link_teams ):
+ $teams_output .= '' . $name . '';
+ else:
+ $teams_output .= $name;
+ endif;
if ( $team_result != null ):
$main_results[] = $team_result;