diff --git a/includes/admin/settings/class-sp-settings-general.php b/includes/admin/settings/class-sp-settings-general.php index 20b733c3..1eb1e1e8 100644 --- a/includes/admin/settings/class-sp-settings-general.php +++ b/includes/admin/settings/class-sp-settings-general.php @@ -117,6 +117,19 @@ class SP_Settings_General extends SP_Settings_Page { 'checkboxgroup' => 'end', 'desc_tip' => __( 'This will enable a script allowing the countdowns to be animated.', 'sportspress' ), ), + + array( + 'title' => __( 'Align', 'sportspress' ), + 'id' => 'sportspress_table_text_align', + 'default' => 'default', + 'type' => 'radio', + 'options' => array( + 'default' => __( 'Default', 'sportspress' ), + 'left' => __( 'Left', 'sportspress' ), + 'center' => __( 'Center', 'sportspress' ), + 'right' => __( 'Right', 'sportspress' ), + ), + ), array( 'title' => __( 'Header Offset', 'sportspress' ), diff --git a/includes/class-sp-frontend-scripts.php b/includes/class-sp-frontend-scripts.php index 241d83c2..ce7897bb 100644 --- a/includes/class-sp-frontend-scripts.php +++ b/includes/class-sp-frontend-scripts.php @@ -97,45 +97,47 @@ class SP_Frontend_Scripts { $enabled = get_option( 'sportspress_enable_frontend_css', 'yes' ); $custom = get_option( 'sportspress_custom_css', null ); + $align = get_option( 'sportspress_table_text_align', 'default' ); + $offset = get_option( 'sportspress_header_offset', '' ); if ( $offset === '' ) { $template = get_option( 'template' ); $offset = ( 'twentyfourteen' == $template ? 48 : 0 ); } - if ( $enabled == 'yes' || ! empty( $custom ) || $offset != 0 ) { + $colors = (array) get_option( 'sportspress_frontend_css_colors', array() ); + + echo ''; + if ( isset( $colors['link'] ) ) + echo '.sp-data-table tbody a,.sp-data-table tbody a:hover,.sp-calendar tbody a:focus{color: ' . $colors['link'] . ' !important}'; } + + if ( $align != 'default' ) + echo '.sp-data-table th,.sp-data-table td{text-align: ' . $align . ' !important}'; + + if ( $offset != 0 ) + echo ' @media only screen and (min-width: 40.063em) {.sp-header{top: ' . $offset . 'px}}'; + + if ( ! empty( $custom ) ) + echo ' /* SportsPress Custom CSS */ ' . $custom; + + echo ''; } }