diff --git a/includes/widgets/class-sp-widget-league-table.php b/includes/widgets/class-sp-widget-league-table.php
index fd1bf93d..de075aed 100644
--- a/includes/widgets/class-sp-widget-league-table.php
+++ b/includes/widgets/class-sp-widget-league-table.php
@@ -18,7 +18,7 @@ class SP_Widget_League_Table extends WP_Widget {
if ( $title )
echo $before_title . $title . $after_title;
echo '
';
- sp_get_template( 'league-table.php', array( 'id' => $id, 'number' => $number, 'columns' => $columns, 'show_full_table_link' => $show_full_table_link, 'show_team_logo' => $show_team_logo ) );
+ sp_get_template( 'league-table.php', array( 'id' => $id, 'number' => $number, 'columns' => $columns, 'show_full_table_link' => $show_full_table_link, 'show_team_logo' => $show_team_logo, 'show_caption' => true ) );
echo '
';
echo $after_widget;
}
diff --git a/templates/league-table.php b/templates/league-table.php
index 0c65c996..d99a8a77 100644
--- a/templates/league-table.php
+++ b/templates/league-table.php
@@ -15,6 +15,7 @@ $defaults = array(
'columns' => null,
'show_full_table_link' => false,
'show_team_logo' => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false,
+ 'show_caption' => false,
'link_posts' => get_option( 'sportspress_table_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,
@@ -25,7 +26,13 @@ $defaults = array(
extract( $defaults, EXTR_SKIP );
$output = '' .
- '
' . '' . '';
+ '';
+
+if ( $show_caption ):
+ $output .= '' . get_the_title( $id ) . '';
+endif;
+
+$output .= '' . '';
$table = new SP_League_Table( $id );
@@ -69,8 +76,10 @@ foreach( $data as $team_id => $row ):
// Rank
$output .= '| ' . ( $i + 1 ) . ' | ';
- if ( $show_team_logo )
- $name = get_the_post_thumbnail( $team_id, 'sportspress-fit-icon', array( 'class' => 'team-logo' ) ) . ' ' . $name;
+ if ( $show_team_logo ):
+ $logo = get_the_post_thumbnail( $team_id, 'sportspress-fit-icon', array( 'class' => 'team-logo' ) );
+ $name = str_replace( 'wp-post-image', '', $logo ) . ' ' . $name;
+ endif;
if ( $link_posts ):
$permalink = get_post_permalink( $team_id );