Enable fronted table text align settings

This commit is contained in:
Brian Miyaji
2014-06-22 13:05:56 +10:00
parent f6315d35ef
commit bb2c727176
2 changed files with 41 additions and 26 deletions

View File

@@ -118,6 +118,19 @@ class SP_Settings_General extends SP_Settings_Page {
'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' ),
'id' => 'sportspress_header_offset',

View File

@@ -97,14 +97,14 @@ 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 '<style type="text/css">.sp-data-table tbody a,.sp-data-table tbody a:hover,.sp-calendar tbody a,.sp-calendar tbody a:hover{background:none;}';
@@ -128,6 +128,9 @@ class SP_Frontend_Scripts {
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}}';
@@ -137,6 +140,5 @@ class SP_Frontend_Scripts {
echo '</style>';
}
}
}
new SP_Frontend_Scripts();