File manager - Edit - /home/aussies6/public_html/seafoodwarehouse.com.au/wp-content/themes/topshop/customizer/styles.php
Back
<?php /** * Implements styles set in the theme customizer * * @package Customizer Library Demo */ if ( ! function_exists( 'customizer_library_topshop_build_styles' ) && class_exists( 'Customizer_Library_Styles' ) ) : /** * Process user options to generate CSS needed to implement the choices. * * @since 1.0.0. * * @return void */ function customizer_library_topshop_build_styles() { $websafe = ( get_theme_mod( 'topshop-disable-google-fonts', customizer_library_get_default( 'topshop-disable-google-fonts' ) ) == 1 ) ? '-websafe' : ''; // Site Logo Max Width $setting = 'topshop-header-image-logo-max-width'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $logo_max_width = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( 'a.site-logo-img' ), 'declarations' => array( 'max-width' => $logo_max_width . 'px' ) ) ); } // Site Container Set Width $setting = 'topshop-set-container-width'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $container_width = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-container, .site-boxed, .site-boxed .main-navigation.stick-header.stuck' ), 'declarations' => array( 'max-width' => $container_width . 'px' ) ) ); } // Set Sidebar Width $setting = 'topshop-set-sidebar-width'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $sidebar_width = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.woocommerce #container, .woocommerce-page #container, .content-area' ), 'declarations' => array( 'width' => ( 100 - $sidebar_width ) . '%' ) ) ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.widget-area' ), 'declarations' => array( 'width' => $sidebar_width . '%' ) ) ); } // Main Color $color = 'topshop-main-color'; $navcolor = 'topshop-nav-color'; $footercolor = 'topshop-footer-color'; $colormod = get_theme_mod( $color, customizer_library_get_default( $color ) ); $navcolormod = get_theme_mod( $navcolor, customizer_library_get_default( $navcolor ) ); $footercolormod = get_theme_mod( $footercolor, customizer_library_get_default( $footercolor ) ); $bgcolormod = get_theme_mod( $color, customizer_library_get_default( $color ) ); $bghardcolormod = get_theme_mod( $color, customizer_library_get_default( $color ) ); $bgbordercolormod = get_theme_mod( $color, customizer_library_get_default( $color ) ); if ( $colormod !== customizer_library_get_default( $color ) ) { $sancolor = sanitize_hex_color( $colormod ); Customizer_Library_Styles()->add( array( 'selectors' => array( 'a, .search-btn, .site-title a, .social-icon:hover, .error-404.not-found .page-header .page-title span, .search-button .fa-search' ), 'declarations' => array( 'color' => $sancolor ) ) ); } if ( $bgcolormod !== customizer_library_get_default( $color ) ) { $bgsancolor = sanitize_hex_color( $bgcolormod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '#comments .form-submit #submit, .search-block .search-submit, .no-results-btn, button, input[type="button"], input[type="reset"], input[type="submit"], .home-slider-prev, .home-slider-next, .woocommerce ul.products li.product a.add_to_cart_button, .woocommerce-page ul.products li.product a.add_to_cart_button, .woocommerce ul.products li.product .onsale, .woocommerce-page ul.products li.product .onsale, .woocommerce button.button.alt, .woocommerce-page button.button.alt, .woocommerce input.button.alt:hover, .woocommerce-page #content input.button.alt:hover, .woocommerce .cart-collaterals .shipping_calculator .button, .woocommerce-page .cart-collaterals .shipping_calculator .button, .woocommerce a.button, .woocommerce-page a.button, .woocommerce input.button, .woocommerce-page #content input.button, .woocommerce-page input.button, .woocommerce #review_form #respond .form-submit input, .woocommerce-page #review_form #respond .form-submit input, .woocommerce-cart .wc-proceed-to-checkout a.checkout-button, .single-product span.onsale, .header-cart:hover .header-cart-checkout .fa, .main-navigation a:hover, .main-navigation li.current-menu-item > a, .main-navigation li.current_page_item > a, .main-navigation li.current-menu-parent > a, .main-navigation li.current_page_parent > a, .main-navigation li.current-menu-ancestor > a, .main-navigation li.current_page_ancestor > a, .main-navigation button, .wpcf7-submit' ), 'declarations' => array( 'background' => 'inherit', 'background-color' => $bgsancolor ) ) ); } // Site Title Font $setting = 'topshop-title-font'.$websafe; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $websafe ) { $stack = '\''.$mod.'\', sans-serif'; } else { $stack = customizer_library_get_font_stack( $mod ); } if ( $mod != customizer_library_get_default( $setting ) || get_theme_mod( 'topshop-disable-google-fonts' ) == 1 ) { Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-title a' ), 'declarations' => array( 'font-family' => $stack ) ) ); } // Site Title Font Size $setting = 'topshop-title-font-size'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $title_font_size = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-title a' ), 'declarations' => array( 'font-size' => $title_font_size . 'px' ) ) ); } // Site Title Font Size $setting = 'topshop-tagline-font-size'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $title_font_size = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( 'h2.site-description' ), 'declarations' => array( 'font-size' => $title_font_size . 'px !important' ) ) ); } // Site Title Bottom Margin $setting = 'topshop-title-bottom-margin'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $title_bottom_margin = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-title' ), 'declarations' => array( 'margin-bottom' => $title_bottom_margin . 'px !important' ) ) ); } if ( $navcolormod !== customizer_library_get_default( $navcolor ) ) { $navsancolor = sanitize_hex_color( $navcolormod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.main-navigation, .main-navigation.header-stick.stuck, .main-navigation ul ul' ), 'declarations' => array( 'background-color' => $navsancolor ) ) ); } if ( $footercolormod !== customizer_library_get_default( $footercolor ) ) { $footersancolor = sanitize_hex_color( $footercolormod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-footer' ), 'declarations' => array( 'background-color' => $footersancolor ) ) ); } if ( $bghardcolormod !== customizer_library_get_default( $color ) ) { $bghardsancolor = sanitize_hex_color( $bghardcolormod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.header-cart-checkout.cart-has-items .fa-shopping-cart' ), 'declarations' => array( 'background-color' => $bghardsancolor . ' !important' ) ) ); } if ( $bgbordercolormod !== customizer_library_get_default( $color ) ) { $bgbordersancolor = sanitize_hex_color( $bgbordercolormod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.woocommerce ul.products li.product .onsale:after, .woocommerce-page ul.products li.product .onsale:after' ), 'declarations' => array( 'border-right' => '4px solid ' . $bgbordersancolor ) ) ); } // Main Color Hover $colorh = 'topshop-main-color-hover'; $colorhmod = get_theme_mod( $colorh, customizer_library_get_default( $colorh ) ); $bgcolorhmod = get_theme_mod( $colorh, customizer_library_get_default( $colorh ) ); if ( $colorhmod !== customizer_library_get_default( $colorh ) ) { $sancolorh = sanitize_hex_color( $colorhmod ); Customizer_Library_Styles()->add( array( 'selectors' => array( 'a:hover, .widget-area .widget a:hover, .site-footer-widgets .widget a:hover, .search-btn:hover, .search-button .fa-search:hover, .woocommerce #content div.product p.price, .woocommerce-page #content div.product p.price, .woocommerce-page div.product p.price, .woocommerce #content div.product span.price, .woocommerce div.product span.price, .woocommerce-page #content div.product span.price, .woocommerce-page div.product span.price, .woocommerce #content div.product .woocommerce-tabs ul.tabs li.active, .woocommerce div.product .woocommerce-tabs ul.tabs li.active, .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li.active, .woocommerce-page div.product .woocommerce-tabs ul.tabs li.active' ), 'declarations' => array( 'color' => $sancolorh ) ) ); } if ( $bgcolorhmod !== customizer_library_get_default( $colorh ) ) { $bgsancolorh = sanitize_hex_color( $bgcolorhmod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.main-navigation button:hover, #comments .form-submit #submit:hover, .search-block .search-submit:hover, .no-results-btn:hover, button, input[type="button"], input[type="reset"], input[type="submit"], .home-slider-prev:hover, .home-slider-next:hover, .woocommerce input.button.alt, .woocommerce-page #content input.button.alt, .woocommerce .cart-collaterals .shipping_calculator .button, .woocommerce-page .cart-collaterals .shipping_calculator .button, .woocommerce a.button:hover, .woocommerce-page a.button:hover, .woocommerce input.button:hover, .woocommerce-page #content input.button:hover, .woocommerce-page input.button:hover, .woocommerce ul.products li.product a.add_to_cart_button:hover, .woocommerce-page ul.products li.product a.add_to_cart_button:hover, .woocommerce button.button.alt:hover, .woocommerce-page button.button.alt:hover, .woocommerce #review_form #respond .form-submit input:hover, .woocommerce-page #review_form #respond .form-submit input:hover, .woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover, .wpcf7-submit:hover' ), 'declarations' => array( 'background' => 'inherit', 'background-color' => $bgsancolorh ) ) ); } // Body Font $font = 'topshop-body-font'.$websafe; $fontmod = get_theme_mod( $font, customizer_library_get_default( $font ) ); if ( $websafe ) { $fontstack = '\''.$fontmod.'\', sans-serif'; } else { $fontstack = customizer_library_get_font_stack( $fontmod ); } $fontcolor = 'topshop-body-font-color'; $fontcolormod = get_theme_mod( $fontcolor, customizer_library_get_default( $fontcolor ) ); if ( $fontmod != customizer_library_get_default( $font ) || get_theme_mod( 'topshop-disable-google-fonts' ) == 1 ) { Customizer_Library_Styles()->add( array( 'selectors' => array( 'body' ), 'declarations' => array( 'font-family' => $fontstack ) ) ); } if ( $fontcolormod !== customizer_library_get_default( $fontcolor ) ) { $sanfontcolor = sanitize_hex_color( $fontcolormod ); Customizer_Library_Styles()->add( array( 'selectors' => array( 'body, .widget-area .widget a, .site-footer-widgets a' ), 'declarations' => array( 'color' => $sanfontcolor ) ) ); } // Heading Font $hfont = 'topshop-heading-font'.$websafe; $hfontmod = get_theme_mod( $hfont, customizer_library_get_default( $hfont ) ); if ( $websafe ) { $hfontstack = '\''.$hfontmod.'\', sans-serif'; } else { $hfontstack = customizer_library_get_font_stack( $hfontmod ); } $hfontcolor = 'topshop-heading-font-color'; $hfontcolormod = get_theme_mod( $hfontcolor, customizer_library_get_default( $hfontcolor ) ); if ( $hfontmod != customizer_library_get_default( $hfont ) || get_theme_mod( 'topshop-disable-google-fonts' ) == 1 ) { Customizer_Library_Styles()->add( array( 'selectors' => array( 'h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, .woocommerce table.cart th, .woocommerce-page #content table.cart th, .woocommerce-page table.cart th, .woocommerce input.button.alt, .woocommerce-page #content input.button.alt, .woocommerce table.cart input, .woocommerce-page #content table.cart input, .woocommerce-page table.cart input, button, input[type="button"], input[type="reset"], input[type="submit"]' ), 'declarations' => array( 'font-family' => $hfontstack ) ) ); } if ( $hfontcolormod !== customizer_library_get_default( $hfontcolor ) ) { $sanhfontcolor = sanitize_hex_color( $hfontcolormod ); Customizer_Library_Styles()->add( array( 'selectors' => array( 'h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a' ), 'declarations' => array( 'color' => $sanhfontcolor ) ) ); } if ( get_theme_mod( 'topshop-footer-customize' ) ) : // Site Footer Column Widths $setting = 'topshop-footer-customize-col-1'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $col_width = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.footer-custom-block.footer-custom-one' ), 'declarations' => array( 'width' => $col_width . '%' ) ) ); } $setting = 'topshop-footer-customize-col-2'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $col_width = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.footer-custom-block.footer-custom-two' ), 'declarations' => array( 'width' => $col_width . '%' ) ) ); } $setting = 'topshop-footer-customize-col-3'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $col_width = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.footer-custom-block.footer-custom-three' ), 'declarations' => array( 'width' => $col_width . '%' ) ) ); } $setting = 'topshop-footer-customize-col-4'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $col_width = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.footer-custom-block.footer-custom-four' ), 'declarations' => array( 'width' => $col_width . '%' ) ) ); } $setting = 'topshop-footer-customize-col-5'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $col_width = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.footer-custom-block.footer-custom-five' ), 'declarations' => array( 'width' => $col_width . '%' ) ) ); } endif; $setting = 'topshop-site-boxed-bg-color'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $color = sanitize_hex_color( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-boxed' ), 'declarations' => array( 'background-color' => $color ) ) ); } // Header Colors $setting = 'topshop-header-bg-color'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $color = sanitize_hex_color( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-header, .topshop-header-layout-standard .site-top-bar-left, .topshop-header-layout-standard .site-top-bar-right, .topshop-header-layout-centered .site-top-bar-left, .topshop-header-layout-centered .site-top-bar-right, .topshop-header-layout-three .site-top-bar-left, .topshop-header-layout-three .site-top-bar-right' ), 'declarations' => array( 'background-color' => $color ) ) ); } $setting = 'topshop-header-font-color'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $color = sanitize_hex_color( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-header' ), 'declarations' => array( 'color' => $color ) ) ); } // Header Top Bar Colors $setting = 'topshop-topbar-bg-color'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $color = sanitize_hex_color( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-top-bar, .topshop-header-layout-standard .site-top-bar-left, .topshop-header-layout-standard .site-top-bar-right, .topshop-header-layout-centered .site-top-bar-left, .topshop-header-layout-centered .site-top-bar-right, .topshop-header-layout-three .site-top-bar-left, .topshop-header-layout-three .site-top-bar-right' ), 'declarations' => array( 'background-color' => $color ) ) ); } $setting = 'topshop-topbar-font-color'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $color = sanitize_hex_color( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-top-bar' ), 'declarations' => array( 'color' => $color ) ) ); } $setting = 'topshop-nav-font-color'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $color = sanitize_hex_color( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.main-navigation' ), 'declarations' => array( 'color' => $color ) ) ); } $setting = 'topshop-sidebar-head-color'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $color = sanitize_hex_color( $mod ); $rgba_color = customizer_library_hex_to_rgb( $color ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.widget-area .widget-title, .widget-area .widgettitle' ), 'declarations' => array( 'color' => $color ) ) ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.widget-area .widget-title, .widget-area .widgettitle' ), 'declarations' => array( 'border-bottom' => '1px solid rgba(' . $rgba_color['r'] . ', ' . $rgba_color['g'] . ', ' . $rgba_color['b'] . ', 0.2);' ) ) ); } // Footer Colors $setting = 'topshop-footer-font-color'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $color = sanitize_hex_color( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-footer, .site-footer-widgets .widget a' ), 'declarations' => array( 'color' => $color ) ) ); } $setting = 'topshop-footer-head-font-color'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $color = sanitize_hex_color( $mod ); $rgba_color = customizer_library_hex_to_rgb( $color ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-footer-widgets li .widgettitle, .site-footer-widgets li .widget-title' ), 'declarations' => array( 'color' => $color . ' !important' ) ) ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-footer-widgets li .widgettitle, .site-footer-widgets li .widget-title' ), 'declarations' => array( 'border-bottom' => '1px solid rgba(' . $rgba_color['r'] . ', ' . $rgba_color['g'] . ', ' . $rgba_color['b'] . ', 0.2) !important;' ) ) ); } $setting = 'topshop-footer-bottombar-bg-color'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $color = sanitize_hex_color( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-footer-bottom-bar' ), 'declarations' => array( 'background-color' => $color ) ) ); } $setting = 'topshop-footer-bottombar-font-color'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $color = sanitize_hex_color( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-footer-bottom-bar' ), 'declarations' => array( 'color' => $color ) ) ); } // Remove WC Categories Count $setting = 'topshop-remove-cats-count'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $logo_max_width = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( 'ul.products mark.count' ), 'declarations' => array( 'display' => 'none' ) ) ); } $setting = 'topshop-footer-social-icon-size'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $footer_social_size = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-footer-social .social-icon' ), 'declarations' => array( 'font-size' => $footer_social_size . 'px' ) ) ); } $setting = 'topshop-footer-social-icon-space'; $mod = get_theme_mod( $setting, customizer_library_get_default( $setting ) ); if ( $mod !== customizer_library_get_default( $setting ) ) { $footer_social_size = esc_attr( $mod ); Customizer_Library_Styles()->add( array( 'selectors' => array( '.site-footer-social .social-icon' ), 'declarations' => array( 'margin' => '0 ' . $footer_social_size . 'px 25px' ) ) ); } } endif; add_action( 'customizer_library_styles', 'customizer_library_topshop_build_styles' ); if ( ! function_exists( 'customizer_library_topshop_styles' ) ) : /** * Generates the style tag and CSS needed for the theme options. * * By using the "Customizer_Library_Styles" filter, different components can print CSS in the header. * It is organized this way to ensure there is only one "style" tag. * * @since 1.0.0. * * @return void */ function customizer_library_topshop_styles() { do_action( 'customizer_library_styles' ); // Echo the rules $css = Customizer_Library_Styles()->build(); if ( ! empty( $css ) ) { echo "\n<!-- Begin Custom CSS -->\n<style type=\"text/css\" id=\"kaira-custom-css\">\n"; echo $css; echo "\n</style>\n<!-- End Custom CSS -->\n"; } } endif; add_action( 'wp_head', 'customizer_library_topshop_styles', 11 );
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings