diff --git a/includes/sp-template-functions.php b/includes/sp-template-functions.php index dc2493f5..dba4907e 100644 --- a/includes/sp-template-functions.php +++ b/includes/sp-template-functions.php @@ -516,15 +516,14 @@ if ( ! function_exists( 'sportspress_responsive_tables_css' ) ) { * @subpackage Responsive * @return void */ - function sportspress_responsive_tables_css( $vars, $identity, $theme = null ) { + function sportspress_responsive_tables_css( $vars, $identity ) { $custom_css = '/* Max width before this PARTICULAR table gets nasty This query will take effect for any screen smaller than 760px and also iPads specifically. */ @media - only screen and (max-width: 760px), - (min-device-width: 768px) and (max-device-width: 1024px) { + only screen and (max-width: 800px) { /* Force table to not be like tables anymore */ table.'.$identity.', table.'.$identity.' thead, table.'.$identity.' tbody, table.'.$identity.' th, table.'.$identity.' td, table.'.$identity.' tr { @@ -541,16 +540,14 @@ if ( ! function_exists( 'sportspress_responsive_tables_css' ) ) { width: auto !important; } - .sp-data-table [class*="data"] { + .sp-data-table th, + .sp-data-table td { text-align: center !important; } - table.'.$identity.' tr { border: 1px solid #ccc; } - table.'.$identity.' td { /* Behave like a "row" */ border: none; - border-bottom: 1px solid #eee; position: relative; padding-left: 50%; vertical-align: middle; @@ -578,92 +575,6 @@ if ( ! function_exists( 'sportspress_responsive_tables_css' ) ) { $k++; } - switch ( $theme ) { - - case 'Emblem': - $custom_css .= '/* Zebra striping */ - table.'.$identity.' tr:nth-of-type(odd) { - background: rgba(65, 166, 42, 0.25); !important; - } - - /*table.'.$identity.' tr:nth-of-type(even) { - background: rgb(30, 118, 19); !important; - }*/'; - break; - case 'Courtside': - $custom_css .= '/* Zebra striping */ - table.'.$identity.' tr:nth-of-type(odd) { - background: #eee !important; - } - - table.'.$identity.' tr:nth-of-type(even) { - background: #fff !important; - } - - /* Make the links visible */ - .sp-data-table [class*="data"] a{ - color: #0f8bca; - } - - /* Small fix for padding */ - table.'.$identity.' td:last-child { - padding-right: 0.25em; - }'; - break; - case 'Premier': - $custom_css .= '/* Zebra striping */ - table.'.$identity.' tr:nth-of-type(odd) { - background: #eee !important; - } - - table.'.$identity.' tr:nth-of-type(even) { - background: #fff !important; - } - - /* Make the links visible */ - .sp-data-table [class*="data"] a{ - color: #0f8bca; - } - - /* Small fix for padding */ - table.'.$identity.' td:last-child { - padding-right: 0.25em; - }'; - break; - case 'Marquee': - $custom_css .= '/* Zebra striping */ - table.'.$identity.' tr:nth-of-type(odd) { - background: #f3f3f3 !important; - } - - /*table.'.$identity.' tr:nth-of-type(even) { - background: #fff !important; - }*/'; - break; - case 'Rookie': - $custom_css .= '/* Zebra striping */ - table.'.$identity.' tr:nth-of-type(odd) { - background: #eee !important; - } - - table.'.$identity.' tr:nth-of-type(even) { - background: #fff !important; - }'; - break; - case 'Football Club': - break; - default: - $custom_css .= '/* Zebra striping */ - table.'.$identity.' tr:nth-of-type(odd) { - background: #eee !important; - } - - table.'.$identity.' tr:nth-of-type(even) { - background: #fff !important; - }'; - break; - } - $custom_css .= ' } '; $dummystyle = 'sportspress-style-inline-'.$identity; diff --git a/templates/event-list.php b/templates/event-list.php index 4bed2287..baf8029a 100644 --- a/templates/event-list.php +++ b/templates/event-list.php @@ -452,8 +452,7 @@ $identifier = uniqid( 'eventlist_' ); get( 'Name' ); - sportspress_responsive_tables_css( $labels, $identifier, $theme_name ); + sportspress_responsive_tables_css( $labels, $identifier ); } if ( $id && $show_all_events_link ) echo '
'; diff --git a/templates/event-performance-table.php b/templates/event-performance-table.php index e022ede2..228f9bb5 100644 --- a/templates/event-performance-table.php +++ b/templates/event-performance-table.php @@ -268,6 +268,5 @@ $identifier = uniqid( 'performance_' ); get( 'Name' ); - sportspress_responsive_tables_css( $rlabels, $identifier, $theme_name ); + sportspress_responsive_tables_css( $rlabels, $identifier ); } diff --git a/templates/league-table.php b/templates/league-table.php index ca69d4e6..f2499ce3 100644 --- a/templates/league-table.php +++ b/templates/league-table.php @@ -66,8 +66,7 @@ $data = $table->data(); $labels = $data[0]; // If responsive tables are enabled then load the inline css code if ( true == $responsive ){ - $theme_name = wp_get_theme()->get( 'Name' ); - sportspress_responsive_tables_css( $labels, $identifier, $theme_name ); + sportspress_responsive_tables_css( $labels, $identifier ); } // Remove the first row to leave us with the actual data unset( $data[0] ); diff --git a/templates/player-list.php b/templates/player-list.php index 553a216b..d0fdb791 100644 --- a/templates/player-list.php +++ b/templates/player-list.php @@ -60,8 +60,7 @@ $labels = $data[0]; $identifier = uniqid( 'playerlist_' ); // If responsive tables are enabled then load the inline css code if ( true == $responsive ){ - $theme_name = wp_get_theme()->get( 'Name' ); - sportspress_responsive_tables_css( $labels, $identifier, $theme_name ); + sportspress_responsive_tables_css( $labels, $identifier ); } // Remove the first row to leave us with the actual data unset( $data[0] );