File manager - Edit - /home/contenidosenred/public_html/OD/wp-content/themes/streamit/inc/custom/dynamic-style.php
Back
<?php if ( !function_exists( 'streamit_create_dynamic_style' ) ) { function streamit_create_dynamic_style() { $streamit_dynamic_css = array(); $streamit_dynamic_css_min_width_1200px = array(); $streamit_options = get_option('streamit_options'); $loader_width = ''; $loader_height = ''; if(!empty($streamit_options["logo-dimensions"]["width"])) { $logo_width = $streamit_options["logo-dimensions"]["width"]; } if(!empty($streamit_options["logo-dimensions"]["height"])) { $logo_height = $streamit_options["logo-dimensions"]["height"]; } if(!empty($streamit_options["vertical-logo-dimensions"]["width"])) { $vertical_logo_width = $streamit_options["vertical-logo-dimensions"]["width"]; } if(!empty($streamit_options["vertical-logo-dimensions"]["height"])) { $vertical_logo_height = $streamit_options["vertical-logo-dimensions"]["height"]; } if(!empty($streamit_options["loader-dimensions"]["width"])) { $loader_width = $streamit_options["loader-dimensions"]["width"]; } if(!empty($streamit_options["loader-dimensions"]["height"])) { $loader_height = $streamit_options["loader-dimensions"]["height"]; } if(isset($streamit_options["body_font"]["font-family"])) { $body_family = $streamit_options["body_font"]["font-family"]; } if(isset($streamit_options["body_font"]["font-backup"])) { $body_backup = $streamit_options["body_font"]["font-backup"]; } if(isset($streamit_options["body_font"]["font-size"])){ $body_size = $streamit_options["body_font"]["font-size"]; } if(isset($streamit_options["body_font"]["font-weight"])){ $body_weight = $streamit_options["body_font"]["font-weight"]; } if(isset($streamit_options["h1_font"]["font-family"])) { $h1_family = $streamit_options["h1_font"]["font-family"]; } if(isset($streamit_options["h1_font"]["font-size"])) { $h1_size = $streamit_options["h1_font"]["font-size"]; } if(isset($streamit_options["h1_font"]["font-weight"])) { $h1_weight = $streamit_options["h1_font"]["font-weight"]; } if(isset($streamit_options["h2_font"]["font-family"])) { $h2_family = $streamit_options["h2_font"]["font-family"]; } if(isset($streamit_options["h2_font"]["font-size"])) { $h2_size = $streamit_options["h2_font"]["font-size"]; } if(isset($streamit_options["h2_font"]["font-weight"])) { $h2_weight = $streamit_options["h2_font"]["font-weight"]; } if(isset($streamit_options["h3_font"]["font-family"])) { $h3_family = $streamit_options["h3_font"]["font-family"]; } if(isset($streamit_options["h3_font"]["font-size"])) { $h3_size = $streamit_options["h3_font"]["font-size"]; } if(isset($streamit_options["h3_font"]["font-weight"])) { $h3_weight = $streamit_options["h3_font"]["font-weight"]; } if(isset($streamit_options["h4_font"]["font-family"])) { $h4_family = $streamit_options["h4_font"]["font-family"]; } if(isset($streamit_options["h4_font"]["font-size"])) { $h4_size = $streamit_options["h4_font"]["font-size"]; } if(isset($streamit_options["h4_font"]["font-weight"])) { $h4_weight = $streamit_options["h4_font"]["font-weight"]; } if(isset($streamit_options["h5_font"]["font-family"])) { $h5_family = $streamit_options["h5_font"]["font-family"]; } if(isset($streamit_options["h5_font"]["font-size"])) { $h5_size = $streamit_options["h5_font"]["font-size"]; } if(isset($streamit_options["h5_font"]["font-weight"])) { $h5_weight = $streamit_options["h5_font"]["font-weight"]; } if(isset($streamit_options["h6_font"]["font-family"])) { $h6_family = $streamit_options["h6_font"]["font-family"]; } if(isset($streamit_options["h6_font"]["font-size"])) { $h6_size = $streamit_options["h6_font"]["font-size"]; } if(isset($streamit_options["h6_font"]["font-weight"])) { $h6_weight = $streamit_options["h6_font"]["font-weight"]; } if(!empty($logo_width)){ $streamit_dynamic_css[] = array( 'elements' => 'header.style-one a.navbar-brand img, .vertical-navbar-brand img', 'property' => 'width', 'value' => $logo_width. '!important' ); } if(!empty($logo_height)){ $streamit_dynamic_css[] = array( 'elements' => 'header.style-one a.navbar-brand img, .vertical-navbar-brand img', 'property' => 'height', 'value' => $logo_height. '!important' ); } if(!empty($vertical_logo_width)){ $streamit_dynamic_css[] = array( 'elements' => 'header.style-vertical a.navbar-brand img', 'property' => 'width', 'value' => $vertical_logo_width. '!important' ); } if(!empty($vertical_logo_height)){ $streamit_dynamic_css[] = array( 'elements' => 'header.style-vertical a.navbar-brand img', 'property' => 'height', 'value' => $vertical_logo_height. '!important' ); } if(!empty($loader_width)){ $streamit_dynamic_css[] = array( 'elements' => '#loading img', 'property' => 'width', 'value' => $loader_width. '!important' ); } if(!empty($loader_height)){ $streamit_dynamic_css[] = array( 'elements' => '#loading img', 'property' => 'height', 'value' => $loader_height. '!important' ); } if(isset($streamit_options['header_radio']) && $streamit_options['header_radio'] == 1 ){ if(!empty($header_font_family)){ $streamit_dynamic_css[] = array( 'elements' => 'h1', 'property' => 'font-family', 'value' => $header_font_family. '!important' ); } if(!empty($header_font_size)){ $streamit_dynamic_css[] = array( 'elements' => 'h1', 'property' => 'font-size', 'value' => $header_font_size. '!important' ); } if(!empty($header_font_weight)){ $streamit_dynamic_css[] = array( 'elements' => 'h1', 'property' => 'font-weight', 'value' => $header_font_weight. '!important' ); } } // Change font 1 if( isset($streamit_options['streamit_change_font']) && $streamit_options['streamit_change_font'] == 1 ){ // body $streamit_dynamic_css[] = array( 'elements' => 'body', 'property' => 'font-family', 'value' => $body_family. $body_backup. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'body', 'property' => 'font-size', 'value' => $body_size. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'body', 'property' => 'font-weight', 'value' => $body_weight. '!important' ); // h2 menu $streamit_dynamic_css[] = array( 'elements' => 'h1', 'property' => 'font-family', 'value' => $h1_family. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'h1', 'property' => 'font-size', 'value' => $h1_size. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'h1', 'property' => 'font-weight', 'value' => $h1_weight. '!important' ); // h2 menu $streamit_dynamic_css[] = array( 'elements' => 'h2', 'property' => 'font-family', 'value' => $h2_family. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'h2', 'property' => 'font-size', 'value' => $h2_size. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'h2', 'property' => 'font-weight', 'value' => $h2_weight. '!important' ); // h3 menu $streamit_dynamic_css[] = array( 'elements' => 'h3', 'property' => 'font-family', 'value' => $h3_family. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'h3', 'property' => 'font-size', 'value' => $h3_size. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'h3', 'property' => 'font-weight', 'value' => $h3_weight. '!important' ); // h4 menu $streamit_dynamic_css[] = array( 'elements' => 'h4', 'property' => 'font-family', 'value' => $h4_family. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'h4', 'property' => 'font-size', 'value' => $h4_size. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'h4', 'property' => 'font-weight', 'value' => $h4_weight. '!important' ); // h5 menu $streamit_dynamic_css[] = array( 'elements' => 'h5', 'property' => 'font-family', 'value' => $h5_family. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'h5', 'property' => 'font-size', 'value' => $h5_size. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'h5', 'property' => 'font-weight', 'value' => $h5_weight. '!important' ); // h6 menu $streamit_dynamic_css[] = array( 'elements' => 'h6', 'property' => 'font-family', 'value' => $h6_family. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'h6', 'property' => 'font-size', 'value' => $h6_size. '!important' ); $streamit_dynamic_css[] = array( 'elements' => 'h6', 'property' => 'font-weight', 'value' => $h6_weight. '!important' ); } // } // Start generating if related arrays are populated if ( count( $streamit_dynamic_css ) > 0 ) { echo "<style type='text/css' id='streamit-dynamic-css'>\n\n"; // Basic dynamic CSS if ( count( $streamit_dynamic_css ) > 0 ) { streamit_dynamic_style( $streamit_dynamic_css ); } echo '</style>'; } } } add_action( 'wp_head', 'streamit_create_dynamic_style' ); if ( !function_exists( 'streamit_create_dynamic_style' ) ) { function streamit_create_dynamic_style() { $streamit_dynamic_css = array(); $streamit_dynamic_css_min_width_1200px = array(); $streamit_options = get_option('streamit_options'); $loader_width = ''; $loader_height = ''; if(!empty($streamit_options["logo-dimensions"]["width"])) { $logo_width = $streamit_options["logo-dimensions"]["width"]; } if(!empty($streamit_options["logo-dimensions"]["height"])) { $logo_height = $streamit_options["logo-dimensions"]["height"]; } if(!empty($streamit_options["loader-dimensions"]["width"])) { $loader_width = $streamit_options["loader-dimensions"]["width"]; } if(!empty($streamit_options["loader-dimensions"]["height"])) { $loader_height = $streamit_options["loader-dimensions"]["height"]; } $streamit_dynamic_css[] = array( 'elements' => '.navbar-brand img, .vertical-navbar-brand img', 'property' => 'width', 'value' => $logo_width. '!important' ); $streamit_dynamic_css[] = array( 'elements' => '.navbar-brand img, .vertical-navbar-brand img', 'property' => 'height', 'value' => $logo_height. '!important' ); // Start generating if related arrays are populated if ( count( $streamit_dynamic_css ) > 0 ) { echo "<style type='text/css' id='streamit-dynamic-css'>\n\n"; // Basic dynamic CSS if ( count( $streamit_dynamic_css ) > 0 ) { streamit_dynamic_style( $streamit_dynamic_css ); } echo '</style>'; } } } add_action( 'wp_head', 'streamit_create_dynamic_style' );
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 0.04 |
proxy
|
phpinfo
|
Settings