'#highlight-service-section', 'appzend_features_service' => '#get-started', 'appzend_features_service' => '#get-started', 'appzend_aboutus' => '#aboutus', 'appzend_calltoaction' => '#app-cta', 'appzend_howitworks' => '#app-how-it-works', 'appzend_recentwork' => '#app-portfolio', 'appzend_service' => '#appzend-service-section', ); foreach($dynamic_sections as $section => $parent): $background = get_theme_mod($section."_bg_color"); $super_title_color = get_theme_mod($section."_super_title_color"); $title_color = get_theme_mod($section."_title_color"); $subtitle_color = get_theme_mod($section."_subtitle_color"); $_margin = get_theme_mod($section."_margin"); $_padding = get_theme_mod($section."_padding"); $box_bg_color = get_theme_mod($section."_box_bg_color"); $icon_color = get_theme_mod($section."_icon_color"); $title_color = get_theme_mod($section."_title_color"); $text_color = get_theme_mod($section."_text_color"); $bg_hov_color = get_theme_mod($section."_bg_hov_color"); $icon_hov_color = get_theme_mod($section."_icon_hov_color"); $title_hov_color = get_theme_mod($section."_title_hov_color"); $text_hov_color = get_theme_mod($section."_text_hov_color"); //margin $_margin = json_decode( $_margin, true ); $section_style = $section_style_tablet = $section_style_mobile = ""; // desktop margin $_margin_desktop = appzend_cssbox_values_inline( $_margin, 'desktop' ); if ( strpos( $_margin_desktop, 'px' ) !== false ) { $section_style .= 'margin:' . $_margin_desktop . ';'; } // tablet margin $_margin_desktop = appzend_cssbox_values_inline( $_margin, 'tablet' ); if ( strpos( $_margin_desktop, 'px' ) !== false ) { $section_style_tablet .= 'margin:' . $_margin_desktop . ';'; } // mobile margin $_margin_desktop = appzend_cssbox_values_inline( $_margin, 'mobile' ); if ( strpos( $_margin_desktop, 'px' ) !== false ) { $section_style_mobile .= 'margin:' . $_margin_desktop . ';'; } $_padding = json_decode( $_padding, true ); // desktop padding $_padding_desktop = appzend_cssbox_values_inline( $_padding, 'desktop' ); if ( strpos( $_padding_desktop, 'px' ) !== false ) { $section_style .= 'padding:' . $_padding_desktop . ';'; } // tablet padding $_padding_desktop = appzend_cssbox_values_inline( $_padding, 'tablet' ); if ( strpos( $_padding_desktop, 'px' ) !== false ) { $section_style_tablet .= 'padding:' . $_padding_desktop . ';'; } // mobile padding $_padding_desktop = appzend_cssbox_values_inline( $_padding, 'mobile' ); if ( strpos( $_padding_desktop, 'px' ) !== false ) { $section_style_mobile .= 'padding:' . $_padding_desktop . ';'; } if( $background ) { $css = []; $css[] = "$background"; $section_style .= implode(';', $css); } if($section_style) $appzend_dynamic .= " {$parent} { $section_style } "; if($section_style_tablet) $appzend_dynamic_tablet .= " {$parent} { $section_style_tablet } "; if($section_style_mobile) $appzend_dynamic_mobile .= " {$parent} { $section_style_mobile } "; if($super_title_color){ $appzend_dynamic .= " {$parent} .headlines h4{ color: {$super_title_color}; }"; } if($title_color){ $appzend_dynamic .=" {$parent} .headlines h2{ color: {$title_color}; }"; } if($subtitle_color){ $appzend_dynamic .=" {$parent} .headlines p{ color: {$subtitle_color}; }"; } /** * Box Dynamic */ $appzend_dynamic .= " {$parent} .section-box{ background-color: $box_bg_color } {$parent} .section-box .box-title{ color: $title_color } {$parent} .section-box .box-content{ color: $text_color } {$parent} .section-box .box-icon{ color: $icon_color } {$parent} .section-box:hover{ background-color: $bg_hov_color } {$parent} .section-box:hover .box-title{ color: $title_hov_color } {$parent} .section-box:hover .box-content{ color: $text_hov_color } {$parent} .section-box:hover .box-icon{ color: $icon_hov_color } "; if( $section == "appzend_features_service" ): $appzend_dynamic .= " {$parent} .section-box .hex { background-color: $bg_hov_color; border-color: $bg_hov_color} {$parent} .section-box:hover .hex { background-color: $box_bg_color; border-color: $box_bg_color} "; endif; if( $section == 'appzend_service'): $icon_bg_color = get_theme_mod($section."_icon_and_before_color"); if( $icon_bg_color){ $css[] = "$icon_bg_color"; $section_style = implode(';', $css); $appzend_dynamic .= " {$parent} .section-box .box-icon i.icon, {$parent} .get-started-item::before{ $section_style } "; } endif; endforeach; if ( has_header_image() ) { $appzend_dynamic .= '#masthead{ background-image: url("' . esc_url( get_header_image() ) . '"); background-repeat: no-repeat; background-position: center center; background-size: cover; }'; } $appzend_dynamic .= "@media screen and (max-width:768px){{$appzend_dynamic_tablet}}"; $appzend_dynamic .= "@media screen and (max-width:480px){{$appzend_dynamic_mobile}}"; $appzend_dynamic = apply_filters( 'appzend_dynamic_css', $appzend_dynamic ); wp_add_inline_style( 'appzend-style', $appzend_dynamic ); } } add_action( 'wp_enqueue_scripts', 'appzend_dynamic_css', 99 );