Add table padding setting to general options
This commit is contained in:
@@ -96,6 +96,19 @@ class SP_Settings_General extends SP_Settings_Page {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Padding', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_table_padding',
|
||||||
|
'class' => 'small-text',
|
||||||
|
'default' => null,
|
||||||
|
'placeholder' => __( 'Auto', 'sportspress' ),
|
||||||
|
'desc' => 'px',
|
||||||
|
'type' => 'number',
|
||||||
|
'custom_attributes' => array(
|
||||||
|
'step' => 1
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Custom CSS', 'sportspress' ),
|
'title' => __( 'Custom CSS', 'sportspress' ),
|
||||||
'id' => 'sportspress_custom_css',
|
'id' => 'sportspress_custom_css',
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ class SP_Frontend_Scripts {
|
|||||||
$custom = get_option( 'sportspress_custom_css', null );
|
$custom = get_option( 'sportspress_custom_css', null );
|
||||||
|
|
||||||
$align = get_option( 'sportspress_table_text_align', 'default' );
|
$align = get_option( 'sportspress_table_text_align', 'default' );
|
||||||
|
$padding = get_option( 'sportspress_table_padding', null );
|
||||||
|
|
||||||
$offset = get_option( 'sportspress_header_offset', '' );
|
$offset = get_option( 'sportspress_header_offset', '' );
|
||||||
if ( $offset === '' ) {
|
if ( $offset === '' ) {
|
||||||
@@ -131,6 +132,9 @@ class SP_Frontend_Scripts {
|
|||||||
if ( $align != 'default' )
|
if ( $align != 'default' )
|
||||||
echo '.sp-data-table th,.sp-data-table td{text-align: ' . $align . ' !important}';
|
echo '.sp-data-table th,.sp-data-table td{text-align: ' . $align . ' !important}';
|
||||||
|
|
||||||
|
if ( $padding != null )
|
||||||
|
echo '.sp-data-table th,.sp-data-table td{padding: ' . $padding . 'px !important}';
|
||||||
|
|
||||||
if ( $offset != 0 )
|
if ( $offset != 0 )
|
||||||
echo ' @media only screen and (min-width: 40.063em) {.sp-header{top: ' . $offset . 'px}}';
|
echo ' @media only screen and (min-width: 40.063em) {.sp-header{top: ' . $offset . 'px}}';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user