| 1 |
<?php |
| 2 |
|
| 3 |
// add custom styling to header |
| 4 |
function wpc_custom_styling(){ |
| 5 |
$wpc_primary_bg_color = get_option('wpc_primary_bg_color', '#ffffff'); |
| 6 |
$wpc_primary_color = get_option('wpc_primary_color', '#3adfa9'); |
| 7 |
$wpc_secondary_color = get_option('wpc_secondary_color', '#019ee5'); |
| 8 |
|
| 9 |
$wpc_toolbar_buttons_color = get_option('wpc_toolbar_buttons_color', '#4f646d'); |
| 10 |
$wpc_selected_bg_color = get_option('wpc_selected_bg_color', '#afafaf'); |
| 11 |
$wpc_link_color = get_option('wpc_link_color', '#3adfa9'); |
| 12 |
$wpc_standard_button_color = get_option('wpc_standard_button_color', '#4f646d'); |
| 13 |
|
| 14 |
$width = get_option('wpc_row_width', '100%'); |
| 15 |
$max_width = get_option('wpc_row_max_width', '1300px'); |
| 16 |
|
| 17 |
$h1 = get_option('wpc_h1_font_size'); |
| 18 |
$h2 = get_option('wpc_h2_font_size'); |
| 19 |
$h3 = get_option('wpc_h3_font_size'); |
| 20 |
|
| 21 |
$container_padding_top = get_option('wpc_container_padding_top'); |
| 22 |
$container_padding_top = wpc_esc_unit($container_padding_top, 'px'); |
| 23 |
$container_padding_bottom = get_option('wpc_container_padding_bottom'); |
| 24 |
$container_padding_bottom = wpc_esc_unit($container_padding_bottom, 'px'); |
| 25 |
$container_padding_left = get_option('wpc_container_padding_left'); |
| 26 |
$container_padding_left = wpc_esc_unit($container_padding_left, 'px'); |
| 27 |
$container_padding_right = get_option('wpc_container_padding_right'); |
| 28 |
$container_padding_right = wpc_esc_unit($container_padding_right, 'px'); |
| 29 |
|
| 30 |
$container_margin_top = get_option('wpc_container_margin_top'); |
| 31 |
$container_margin_top = wpc_esc_unit($container_margin_top, 'px'); |
| 32 |
$container_margin_bottom = get_option('wpc_container_margin_bottom'); |
| 33 |
$container_margin_bottom = wpc_esc_unit($container_margin_bottom, 'px'); |
| 34 |
|
| 35 |
echo '<style>'; |
| 36 |
|
| 37 |
// styling shim for old quiz versions |
| 38 |
if(!defined('WPCP_VERSION')) { |
| 39 |
echo '.wpc-fe-quiz-question-container { |
| 40 |
width: 100%; |
| 41 |
border-right: 0; |
| 42 |
float: none; |
| 43 |
padding: 0; |
| 44 |
min-height: 0; |
| 45 |
}'; |
| 46 |
} |
| 47 |
|
| 48 |
echo '.wpc-h1 { |
| 49 |
font-size: ' . $h1 . ' !important; |
| 50 |
}'; |
| 51 |
|
| 52 |
echo '.wpc-h2 { |
| 53 |
font-size: ' . $h2 . ' !important; |
| 54 |
}'; |
| 55 |
|
| 56 |
echo '.wpc-h3 { |
| 57 |
font-size: ' . $h3 . ' !important; |
| 58 |
}'; |
| 59 |
|
| 60 |
echo '.wpc-main { |
| 61 |
width: ' . $width . ' !important; |
| 62 |
max-width: ' . $max_width . ' !important; |
| 63 |
padding-top: ' . $container_padding_top . ' !important; |
| 64 |
padding-bottom: ' . $container_padding_bottom . ' !important; |
| 65 |
padding-left: ' . $container_padding_left . ' !important; |
| 66 |
padding-right: ' . $container_padding_right . ' !important; |
| 67 |
margin-top: ' . $container_margin_top . ' !important; |
| 68 |
margin-bottom: ' . $container_margin_bottom . ' !important; |
| 69 |
}'; |
| 70 |
|
| 71 |
echo ':root { |
| 72 |
--wpcbg: ' . esc_html( $wpc_primary_bg_color ) . '; |
| 73 |
--green: ' . esc_html( $wpc_primary_color ) . '; |
| 74 |
--blue: ' . esc_html( $wpc_secondary_color ) . '; |
| 75 |
--tool: ' . esc_html( $wpc_toolbar_buttons_color ) . '; |
| 76 |
--sele: ' . esc_html( $wpc_selected_bg_color ) . '; |
| 77 |
--link: ' . esc_html( $wpc_link_color ) . '; |
| 78 |
--stand: ' . esc_html( $wpc_standard_button_color ) . '; |
| 79 |
}'; |
| 80 |
|
| 81 |
echo '</style>'; |
| 82 |
|
| 83 |
} |
| 84 |
|
| 85 |
add_action('wp_head', 'wpc_custom_styling'); |
| 86 |
add_action('admin_head', 'wpc_custom_styling'); |
| 87 |
|
| 88 |
?> |