Initial commit: Atomaste website
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,118 @@
|
||||
/**
|
||||
* This file adds some LIVE to the Customizer live preview. To leverage
|
||||
* this, set your custom settings to 'postMessage' and then add your handling
|
||||
* here. Your javascript should grab settings from customizer controls, and
|
||||
* then make any necessary changes to the page using jQuery.
|
||||
*
|
||||
* @package Astra
|
||||
* @since 1.7.0
|
||||
*/
|
||||
|
||||
( function( $ ) {
|
||||
|
||||
/* Breadcrumb Typography */
|
||||
astra_responsive_font_size(
|
||||
'astra-settings[breadcrumb-font-size]',
|
||||
'.ast-breadcrumbs-wrapper .trail-items span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after'
|
||||
);
|
||||
astra_generate_outside_font_family_css(
|
||||
'astra-settings[breadcrumb-font-family]',
|
||||
'.ast-breadcrumbs-wrapper .trail-items span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after'
|
||||
);
|
||||
astra_generate_font_weight_css( 'astra-settings[breadcrumb-font-family]', 'astra-settings[breadcrumb-font-weight]', 'font-weight', '.ast-breadcrumbs-wrapper .trail-items span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after' );
|
||||
|
||||
|
||||
|
||||
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Line Height */
|
||||
astra_font_extras_css( 'breadcrumb-font-extras', '.ast-breadcrumbs-wrapper .ast-breadcrumbs-name, .ast-breadcrumbs-wrapper .ast-breadcrumbs-item, .ast-breadcrumbs-wrapper .ast-breadcrumbs .separator, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after' );
|
||||
|
||||
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Text Color */
|
||||
astra_color_responsive_css(
|
||||
'breadcrumb',
|
||||
'astra-settings[breadcrumb-active-color-responsive]',
|
||||
'color',
|
||||
'.ast-breadcrumbs-wrapper .trail-items .trail-end, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast .breadcrumb_last, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-inner, .ast-breadcrumbs-wrapper .breadcrumb-item.active'
|
||||
);
|
||||
|
||||
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Link Color */
|
||||
astra_color_responsive_css(
|
||||
'breadcrumb',
|
||||
'astra-settings[breadcrumb-text-color-responsive]',
|
||||
'color',
|
||||
'.ast-breadcrumbs-wrapper .trail-items a, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast a, .ast-breadcrumbs-wrapper .breadcrumbs a, .ast-breadcrumbs-wrapper .rank-math-breadcrumb a, .ast-breadcrumbs-wrapper .breadcrumb-item a'
|
||||
);
|
||||
|
||||
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Hover Color */
|
||||
astra_color_responsive_css(
|
||||
'breadcrumb',
|
||||
'astra-settings[breadcrumb-hover-color-responsive]',
|
||||
'color',
|
||||
'.ast-breadcrumbs-wrapper .trail-items a:hover, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast a:hover, .ast-breadcrumbs-wrapper .breadcrumbs a:hover, .ast-breadcrumbs-wrapper .rank-math-breadcrumb a:hover, .ast-breadcrumbs-wrapper .breadcrumb-item a:hover'
|
||||
);
|
||||
|
||||
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Separator Color */
|
||||
astra_color_responsive_css(
|
||||
'breadcrumb',
|
||||
'astra-settings[breadcrumb-separator-color]',
|
||||
'color',
|
||||
'.ast-breadcrumbs-wrapper .trail-items li::after, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb .separator, .ast-breadcrumbs-wrapper .breadcrumb-item:after'
|
||||
);
|
||||
|
||||
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Background Color */
|
||||
astra_color_responsive_css(
|
||||
'breadcrumb',
|
||||
'astra-settings[breadcrumb-bg-color]',
|
||||
'background-color',
|
||||
'.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb, .ast-primary-sticky-header-active .main-header-bar.ast-header-breadcrumb'
|
||||
);
|
||||
|
||||
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Alignment */
|
||||
astra_css(
|
||||
'astra-settings[breadcrumb-alignment]',
|
||||
'text-align',
|
||||
'.ast-breadcrumbs-wrapper'
|
||||
);
|
||||
|
||||
/**
|
||||
* Breadcrumb Spacing
|
||||
*/
|
||||
wp.customize( 'astra-settings[breadcrumb-spacing]', function( value ) {
|
||||
value.bind( function( padding ) {
|
||||
var spacing_value = wp.customize( 'astra-settings[breadcrumb-position]' ).get();
|
||||
if( 'astra_header_markup_after' == spacing_value || 'astra_header_after' == spacing_value ) {
|
||||
astra_responsive_spacing( 'astra-settings[breadcrumb-spacing]','.main-header-bar.ast-header-breadcrumb', 'padding', ['top', 'right', 'bottom', 'left' ] );
|
||||
} else if( 'astra_masthead_content' == spacing_value ) {
|
||||
astra_responsive_spacing( 'astra-settings[breadcrumb-spacing]','.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .ast-breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner', 'padding', ['top', 'right', 'bottom', 'left' ] );
|
||||
} else {
|
||||
astra_responsive_spacing( 'astra-settings[breadcrumb-spacing]','.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb, .ast-breadcrumbs-wrapper .ast-breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner', 'padding', ['top', 'right', 'bottom', 'left' ] );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
/**
|
||||
* Breadcrumb Separator.
|
||||
*/
|
||||
wp.customize( 'astra-settings[breadcrumb-separator-selector]', function( value ) {
|
||||
value.bind( function( value ) {
|
||||
const customBreadcrumbValue = wp.customize.value( 'astra-settings[breadcrumb-separator]' )();
|
||||
const currentSelectedSeparator = 'unicode' !== value ? value : customBreadcrumbValue;
|
||||
let dynamicStyle = '';
|
||||
dynamicStyle += '.trail-items li::after {';
|
||||
dynamicStyle += 'content: "' + currentSelectedSeparator + '";';
|
||||
dynamicStyle += '} ';
|
||||
astra_add_dynamic_css( 'breadcrumb-separator-selector', dynamicStyle );
|
||||
} );
|
||||
} );
|
||||
|
||||
wp.customize( 'astra-settings[breadcrumb-separator]', function( value ) {
|
||||
value.bind( function( value ) {
|
||||
let dynamicStyle = '';
|
||||
dynamicStyle += '.trail-items li::after {';
|
||||
dynamicStyle += 'content: "' + value + '";';
|
||||
dynamicStyle += '} ';
|
||||
astra_add_dynamic_css( 'breadcrumb-separator', dynamicStyle );
|
||||
} );
|
||||
} );
|
||||
|
||||
} )( jQuery );
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,197 @@
|
||||
<?php
|
||||
/**
|
||||
* Breadcrumbs Loader for Astra theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://www.brainstormforce.com
|
||||
* @since Astra 1.7.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Breadcrumbs_Loader' ) ) {
|
||||
|
||||
/**
|
||||
* Customizer Initialization
|
||||
*
|
||||
* @since 1.7.0
|
||||
*/
|
||||
class Astra_Breadcrumbs_Loader {
|
||||
|
||||
/**
|
||||
* Member Variable
|
||||
*
|
||||
* @var object instance
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
|
||||
add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 );
|
||||
add_action( 'customize_register', array( $this, 'customize_register' ), 2 );
|
||||
// Load Google fonts.
|
||||
add_action( 'astra_get_fonts', array( $this, 'add_fonts' ), 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue google fonts.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add_fonts() {
|
||||
$breadcrumb_font_family = astra_get_option( 'breadcrumb-font-family' );
|
||||
$breadcrumb_font_weight = astra_get_option( 'breadcrumb-font-weight' );
|
||||
Astra_Fonts::add_font( $breadcrumb_font_family, $breadcrumb_font_weight );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Options Default Values
|
||||
*
|
||||
* @param array $defaults Astra options default value array.
|
||||
* @return array
|
||||
*/
|
||||
public function theme_defaults( $defaults ) {
|
||||
|
||||
$astra_options = Astra_Theme_Options::get_astra_options();
|
||||
|
||||
/**
|
||||
* Breadcrumb Responsive Colors
|
||||
*/
|
||||
$defaults['breadcrumb-text-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['breadcrumb-active-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['breadcrumb-hover-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['breadcrumb-separator-color'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['breadcrumb-bg-color'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['breadcrumb-spacing'] = array(
|
||||
'desktop' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
);
|
||||
|
||||
/**
|
||||
* Breadcrumb Font Defaults
|
||||
*/
|
||||
$defaults['breadcrumb-font-family'] = 'inherit';
|
||||
$defaults['breadcrumb-font-weight'] = 'inherit';
|
||||
$defaults['breadcrumb-font-size'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
);
|
||||
$defaults['breadcrumb-font-extras'] = array(
|
||||
'line-height' => ! isset( $astra_options['breadcrumb-font-extras'] ) && isset( $astra_options['breadcrumb-line-height'] ) ? $astra_options['breadcrumb-line-height'] : '',
|
||||
'line-height-unit' => 'em',
|
||||
'letter-spacing' => '',
|
||||
'letter-spacing-unit' => 'px',
|
||||
'text-transform' => ! isset( $astra_options['breadcrumb-font-extras'] ) && isset( $astra_options['breadcrumb-text-transform'] ) ? $astra_options['breadcrumb-text-transform'] : '',
|
||||
'text-decoration' => '',
|
||||
);
|
||||
|
||||
/**
|
||||
* Breadcrumb Separator defaults
|
||||
*/
|
||||
|
||||
$defaults['breadcrumb-separator-selector'] = '\003E';
|
||||
$defaults['breadcrumb-separator'] = '\00bb';
|
||||
|
||||
return $defaults;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add postMessage support for site title and description for the Theme Customizer.
|
||||
*
|
||||
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
|
||||
*/
|
||||
public function customize_register( $wp_customize ) {
|
||||
|
||||
/**
|
||||
* Register Panel & Sections
|
||||
*/
|
||||
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
||||
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-configs.php';
|
||||
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-color-configs.php';
|
||||
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-typo-configs.php';
|
||||
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Preview
|
||||
*/
|
||||
public function preview_scripts() {
|
||||
/**
|
||||
* Load unminified if SCRIPT_DEBUG is true.
|
||||
*/
|
||||
/* Directory and Extension */
|
||||
$dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
|
||||
$file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
|
||||
wp_enqueue_script( 'astra-breadcrumbs-customizer-preview-js', ASTRA_THEME_BREADCRUMBS_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
Astra_Breadcrumbs_Loader::get_instance();
|
||||
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
/**
|
||||
* Breadcrumbs for Astra theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://www.brainstormforce.com
|
||||
* @since Astra 1.8.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Breadcrumbs_Markup' ) ) {
|
||||
|
||||
/**
|
||||
* Breadcrumbs Markup Initial Setup
|
||||
*
|
||||
* @since 1.8.0
|
||||
*/
|
||||
class Astra_Breadcrumbs_Markup {
|
||||
|
||||
/**
|
||||
* Member Variable
|
||||
*
|
||||
* @var object instance
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
add_action( 'wp', array( $this, 'astra_breadcumb_template' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Astra Breadcrumbs Template
|
||||
*
|
||||
* Loads template based on the style option selected in options panel for Breadcrumbs.
|
||||
*
|
||||
* @since 1.8.0
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function astra_breadcumb_template() {
|
||||
|
||||
$breadcrumb_position = astra_get_option( 'breadcrumb-position' );
|
||||
|
||||
$breadcrumb_enabled = false;
|
||||
|
||||
if ( is_singular() ) {
|
||||
$breadcrumb_enabled = get_post_meta( get_the_ID(), 'ast-breadcrumbs-content', true );
|
||||
}
|
||||
|
||||
if ( 'disabled' !== $breadcrumb_enabled && $breadcrumb_position && 'none' !== $breadcrumb_position && ! ( ( is_home() || is_front_page() ) && ( 'astra_entry_top' === $breadcrumb_position ) ) ) {
|
||||
if ( self::astra_breadcrumb_rules() ) {
|
||||
if ( ( is_archive() || is_search() ) && 'astra_entry_top' === $breadcrumb_position ) {
|
||||
add_action( 'astra_before_archive_title', array( $this, 'astra_hook_breadcrumb_position' ), 15 );
|
||||
} else {
|
||||
add_action( $breadcrumb_position, array( $this, 'astra_hook_breadcrumb_position' ), 15 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Astra Hook Breadcrumb Position
|
||||
*
|
||||
* Hook breadcrumb to position of selected option
|
||||
*
|
||||
* @since 1.8.0
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function astra_hook_breadcrumb_position() {
|
||||
$breadcrumb_position = astra_get_option( 'breadcrumb-position' );
|
||||
|
||||
if ( $breadcrumb_position && ( 'astra_header_markup_after' === $breadcrumb_position || 'astra_header_after' === $breadcrumb_position ) ) {
|
||||
echo '<div class="main-header-bar ast-header-breadcrumb">
|
||||
<div class="ast-container">';
|
||||
}
|
||||
astra_get_breadcrumb();
|
||||
if ( $breadcrumb_position && ( 'astra_header_markup_after' === $breadcrumb_position || 'astra_header_after' === $breadcrumb_position ) ) {
|
||||
echo ' </div>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Astra Breadcrumbs Rules
|
||||
*
|
||||
* Checks the rules defined for displaying Breadcrumb on different pages.
|
||||
*
|
||||
* @since 1.8.0
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function astra_breadcrumb_rules() {
|
||||
|
||||
// Display Breadcrumb default true.
|
||||
$display_breadcrumb = true;
|
||||
|
||||
if ( is_front_page() && '0' == astra_get_option( 'breadcrumb-disable-home-page' ) ) {
|
||||
$display_breadcrumb = false;
|
||||
}
|
||||
|
||||
if ( is_home() && '0' == astra_get_option( 'breadcrumb-disable-blog-posts-page' ) ) {
|
||||
$display_breadcrumb = false;
|
||||
}
|
||||
|
||||
if ( is_search() && '0' == astra_get_option( 'breadcrumb-disable-search' ) ) {
|
||||
$display_breadcrumb = false;
|
||||
}
|
||||
|
||||
if ( ( is_archive() ) && '0' == astra_get_option( 'breadcrumb-disable-archive' ) ) {
|
||||
$display_breadcrumb = false;
|
||||
}
|
||||
|
||||
if ( is_page() && '0' == astra_get_option( 'breadcrumb-disable-single-page' ) ) {
|
||||
$display_breadcrumb = false;
|
||||
}
|
||||
|
||||
if ( is_single() && '0' == astra_get_option( 'breadcrumb-disable-single-post' ) ) {
|
||||
$display_breadcrumb = false;
|
||||
}
|
||||
|
||||
if ( is_singular() && '0' == astra_get_option( 'breadcrumb-disable-singular' ) ) {
|
||||
$display_breadcrumb = false;
|
||||
}
|
||||
|
||||
if ( is_404() && '0' == astra_get_option( 'breadcrumb-disable-404-page' ) ) {
|
||||
$display_breadcrumb = false;
|
||||
}
|
||||
|
||||
return apply_filters( 'astra_breadcrumb_enabled', $display_breadcrumb );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
Astra_Breadcrumbs_Markup::get_instance();
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
/**
|
||||
* Breadcrumbs for Astra theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://www.brainstormforce.com
|
||||
* @since Astra 1.7.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
define( 'ASTRA_THEME_BREADCRUMBS_DIR', ASTRA_THEME_DIR . 'inc/addons/breadcrumbs/' );
|
||||
define( 'ASTRA_THEME_BREADCRUMBS_URI', ASTRA_THEME_URI . 'inc/addons/breadcrumbs/' );
|
||||
|
||||
if ( ! class_exists( 'Astra_Breadcrumbs' ) ) {
|
||||
|
||||
/**
|
||||
* Breadcrumbs Initial Setup
|
||||
*
|
||||
* @since 1.7.0
|
||||
*/
|
||||
class Astra_Breadcrumbs {
|
||||
|
||||
/**
|
||||
* Member Variable
|
||||
*
|
||||
* @var object instance
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor function that initializes required actions and hooks
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
||||
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'class-astra-breadcrumbs-loader.php';
|
||||
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'class-astra-breadcrumbs-markup.php';
|
||||
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'class-astra-breadcrumb-trail.php';
|
||||
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
||||
|
||||
// Third Party plugins in the breadcrumb options.
|
||||
add_filter( 'astra_breadcrumb_source_list', array( $this, 'astra_breadcrumb_source_list_items' ) );
|
||||
|
||||
// Include front end files.
|
||||
if ( ! is_admin() ) {
|
||||
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'dynamic-css/dynamic.css.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Third Party Breadcrumb option
|
||||
*
|
||||
* @param Array $options breadcrumb options array.
|
||||
*
|
||||
* @return Array breadcrumb options array.
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function astra_breadcrumb_source_list_items( $options ) {
|
||||
|
||||
$breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false;
|
||||
$wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable;
|
||||
if ( ! is_array( $wpseo_option ) ) {
|
||||
unset( $wpseo_option );
|
||||
$wpseo_option = array(
|
||||
'breadcrumbs-enable' => $breadcrumb_enable,
|
||||
);
|
||||
}
|
||||
|
||||
if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] ) {
|
||||
$options['yoast-seo-breadcrumbs'] = 'Yoast SEO Breadcrumbs';
|
||||
}
|
||||
|
||||
if ( function_exists( 'bcn_display' ) ) {
|
||||
$options['breadcrumb-navxt'] = 'Breadcrumb NavXT';
|
||||
}
|
||||
|
||||
if ( function_exists( 'rank_math_the_breadcrumbs' ) ) {
|
||||
$options['rank-math'] = 'Rank Math';
|
||||
}
|
||||
|
||||
if ( function_exists( 'seopress_display_breadcrumbs' ) ) {
|
||||
$options['seopress'] = 'SEOPress';
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
Astra_Breadcrumbs::get_instance();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
<?php
|
||||
/**
|
||||
* Colors - Breadcrumbs Options for theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://www.brainstormforce.com
|
||||
* @since Astra 1.7.0
|
||||
*/
|
||||
|
||||
// Block direct access to the file.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Bail if Customizer config base class does not exist.
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes
|
||||
*
|
||||
* @since 1.7.0
|
||||
*/
|
||||
if ( ! class_exists( 'Astra_Breadcrumbs_Color_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Colors and Background - Breadcrumbs Options Customizer Configurations.
|
||||
*/
|
||||
class Astra_Breadcrumbs_Color_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Colors and Background - Breadcrumbs Options Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.7.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$content_colors_control_title = __( 'Content', 'astra' );
|
||||
|
||||
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
|
||||
$content_colors_control_title = __( 'Content Colors', 'astra' );
|
||||
}
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-color-section-divider]',
|
||||
'section' => 'section-breadcumb',
|
||||
'title' => __( 'Colors', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 72,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-spacing' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
|
||||
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/*
|
||||
* Breadcrumb Color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-bg-color]',
|
||||
'type' => 'control',
|
||||
'default' => astra_get_option( 'breadcrumb-bg-color' ),
|
||||
'section' => 'section-breadcrumb',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'title' => __( 'Background Color', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
|
||||
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'priority' => 72,
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-active-color-responsive]',
|
||||
'default' => astra_get_option( 'breadcrumb-active-color-responsive' ),
|
||||
'type' => 'control',
|
||||
'section' => 'section-breadcrumb',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'title' => __( 'Text Color', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
|
||||
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'priority' => 72,
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator-color]',
|
||||
'default' => astra_get_option( 'breadcrumb-separator-color' ),
|
||||
'type' => 'control',
|
||||
'section' => 'section-breadcrumb',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'title' => __( 'Separator Color', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
|
||||
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'priority' => 72,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]',
|
||||
'default' => astra_get_option( 'section-breadcrumb-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Content Link Color', 'astra' ),
|
||||
'section' => 'section-breadcrumb',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 72,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
|
||||
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'responsive' => true,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'breadcrumb-text-color-responsive',
|
||||
'default' => astra_get_option( 'breadcrumb-text-color-responsive' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]',
|
||||
'section' => 'section-breadcrumb',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'control' => 'ast-responsive-color',
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 15,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'breadcrumb-hover-color-responsive',
|
||||
'default' => astra_get_option( 'breadcrumb-hover-color-responsive' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]',
|
||||
'section' => 'section-breadcrumb',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'control' => 'ast-responsive-color',
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 20,
|
||||
),
|
||||
);
|
||||
|
||||
if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) {
|
||||
array_push(
|
||||
$_configs,
|
||||
/**
|
||||
* Option: Divider
|
||||
* Option: breadcrumb color Section divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-color-divider]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'section' => 'section-breadcrumb',
|
||||
'title' => __( 'Colors', 'astra' ),
|
||||
'priority' => 71,
|
||||
'settings' => array(),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
new Astra_Breadcrumbs_Color_Configs();
|
||||
@@ -0,0 +1,569 @@
|
||||
<?php
|
||||
/**
|
||||
* Breadcrumbs Options for Astra theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://www.brainstormforce.com
|
||||
* @since Astra 1.7.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Breadcrumbs_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes Initial setup
|
||||
*/
|
||||
class Astra_Breadcrumbs_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Astra-Breadcrumbs Settings.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.7.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$breadcrumb_source_list = apply_filters(
|
||||
'astra_breadcrumb_source_list',
|
||||
array(
|
||||
'default' => __( 'Default', 'astra' ),
|
||||
),
|
||||
'breadcrumb-list'
|
||||
);
|
||||
|
||||
$_section = 'section-breadcrumb';
|
||||
|
||||
$positions = array(
|
||||
'none' => __( 'None', 'astra' ),
|
||||
'astra_masthead_content' => __( 'Inside', 'astra' ),
|
||||
'astra_header_markup_after' => __( 'After Header', 'astra' ),
|
||||
'astra_entry_top' => __( 'Before Title', 'astra' ),
|
||||
);
|
||||
|
||||
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
|
||||
$positions = array(
|
||||
'none' => __( 'None', 'astra' ),
|
||||
'astra_header_primary_container_after' => __( 'Inside', 'astra' ),
|
||||
'astra_header_after' => __( 'After', 'astra' ),
|
||||
'astra_entry_top' => __( 'Before Title', 'astra' ),
|
||||
);
|
||||
}
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/*
|
||||
* Breadcrumb
|
||||
*/
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'priority' => 20,
|
||||
'title' => __( 'Breadcrumb', 'astra' ),
|
||||
'description_hidden' => true,
|
||||
'description' => $this->section_get_description(
|
||||
array(
|
||||
'description' => '<p><b>' . __( 'Helpful Information', 'astra' ) . '</b></p>',
|
||||
'links' => array(
|
||||
array(
|
||||
'text' => __( 'Breadcrumb Overview', 'astra' ) . ' »',
|
||||
'attrs' => array(
|
||||
'href' => astra_get_pro_url( 'https://wpastra.com/docs/add-breadcrumbs-with-astra/', 'customizer', 'helpful_information', 'astra_theme' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Breadcrumb Position
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'default' => astra_get_option( 'breadcrumb-position', 'none' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Header Position', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-select',
|
||||
'priority' => 5,
|
||||
'choices' => $positions,
|
||||
'partial' => array(
|
||||
'selector' => '.ast-breadcrumbs-wrapper .ast-breadcrumbs .trail-items',
|
||||
'container_inclusive' => false,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Breadcrumb if set to None - Show the notice under the Design tab.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-position-none-notice]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-description',
|
||||
'section' => $_section,
|
||||
'priority' => 5,
|
||||
'label' => '',
|
||||
'help' => __( 'Note: To get design settings in action make sure to select Header Position other than None.', 'astra' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '==',
|
||||
'value' => 'none',
|
||||
),
|
||||
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
|
||||
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-layout-divider]',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Display Settings', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 25,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Disable Breadcrumb on Categories
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-home-page]',
|
||||
'default' => astra_get_option( 'breadcrumb-disable-home-page', '1' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Enable on Home Page?', 'astra' ),
|
||||
'priority' => 25,
|
||||
'control' => 'ast-toggle-control',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Disable Breadcrumb on Categories
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-blog-posts-page]',
|
||||
'default' => astra_get_option( 'breadcrumb-disable-blog-posts-page', '1' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'description' => __( 'Latest posts page or when any page is selected as blog page', 'astra' ),
|
||||
'title' => __( 'Enable on Blog / Posts Page?', 'astra' ),
|
||||
'priority' => 25,
|
||||
'control' => 'ast-toggle-control',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Disable Breadcrumb on Search
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-search]',
|
||||
'default' => astra_get_option( 'breadcrumb-disable-search', '1' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Enable on Search?', 'astra' ),
|
||||
'priority' => 30,
|
||||
'control' => 'ast-toggle-control',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Disable Breadcrumb on Archive
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-archive]',
|
||||
'default' => astra_get_option( 'breadcrumb-disable-archive', '1' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Enable on Archive?', 'astra' ),
|
||||
'priority' => 35,
|
||||
'control' => 'ast-toggle-control',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Disable Breadcrumb on Single Page
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-single-page]',
|
||||
'default' => astra_get_option( 'breadcrumb-disable-single-page', '1' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Enable on Single Page?', 'astra' ),
|
||||
'priority' => 40,
|
||||
'control' => 'ast-toggle-control',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Disable Breadcrumb on Single Post
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-single-post]',
|
||||
'default' => astra_get_option( 'breadcrumb-disable-single-post', '1' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Enable on Single Post?', 'astra' ),
|
||||
'priority' => 45,
|
||||
'control' => 'ast-toggle-control',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Disable Breadcrumb on Singular
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-singular]',
|
||||
'default' => astra_get_option( 'breadcrumb-disable-singular', '1' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'description' => __( 'All Pages, All Posts, All Attachments', 'astra' ),
|
||||
'title' => __( 'Enable on Singular?', 'astra' ),
|
||||
'priority' => 50,
|
||||
'control' => 'ast-toggle-control',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Disable Breadcrumb on 404 Page
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-404-page]',
|
||||
'default' => astra_get_option( 'breadcrumb-disable-404-page', '1' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
|
||||
'title' => __( 'Enable on 404 Page?', 'astra' ),
|
||||
'priority' => 55,
|
||||
'control' => 'ast-toggle-control',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Breadcrumb Alignment
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-alignment]',
|
||||
'default' => astra_get_option( 'breadcrumb-alignment', 'left' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Alignment', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'priority' => 24,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'choices' => array(
|
||||
'left' => 'align-left',
|
||||
'center' => 'align-center',
|
||||
'right' => 'align-right',
|
||||
),
|
||||
'responsive' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider ast-bottom-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Breadcrumb Spacing
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-spacing]',
|
||||
'default' => astra_get_option( 'breadcrumb-spacing' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'priority' => 83,
|
||||
'title' => __( 'Spacing', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
|
||||
'section' => $_section,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
|
||||
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
if ( $this->is_third_party_breadcrumb_active() ) {
|
||||
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[select-breadcrumb-source]',
|
||||
'default' => astra_get_option( 'select-breadcrumb-source', 'default' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Breadcrumb Source', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-select',
|
||||
'priority' => 10,
|
||||
'choices' => $breadcrumb_source_list,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-divider' ),
|
||||
);
|
||||
}
|
||||
|
||||
if ( $this->is_selected_breadcrumb_active() ) {
|
||||
|
||||
/**
|
||||
* Option: Breadcrumb separator
|
||||
*/
|
||||
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator-selector]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-radio-image',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ),
|
||||
'default' => astra_get_option( 'breadcrumb-separator-selector' ),
|
||||
'priority' => 15,
|
||||
'title' => __( 'Separator', 'astra' ),
|
||||
'section' => $_section,
|
||||
'choices' => array(
|
||||
'\003E' => array(
|
||||
'label' => __( 'Type 1', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'breadcrumb-separator-1' ),
|
||||
),
|
||||
'\00BB' => array(
|
||||
'label' => __( 'Type 2', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'breadcrumb-separator-2' ),
|
||||
),
|
||||
'\002F' => array(
|
||||
'label' => __( 'Type 3', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'breadcrumb-separator-3' ),
|
||||
),
|
||||
'unicode' => array(
|
||||
'label' => __( 'Custom separator', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'breadcrumb-separator-unicode' ),
|
||||
),
|
||||
),
|
||||
'alt_layout' => true,
|
||||
'transport' => 'postMessage',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
);
|
||||
|
||||
/**
|
||||
* Option: Breadcrumb Unicode input
|
||||
*/
|
||||
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator]',
|
||||
'type' => 'control',
|
||||
'control' => 'text',
|
||||
'section' => $_section,
|
||||
'default' => astra_get_option( 'breadcrumb-separator' ),
|
||||
'priority' => 15,
|
||||
'title' => __( 'Unicode', 'astra' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator-selector]',
|
||||
'operator' => '=',
|
||||
'value' => 'unicode',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
);
|
||||
}
|
||||
|
||||
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
|
||||
|
||||
$_configs[] = array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
);
|
||||
}
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
|
||||
/**
|
||||
* Is third-party breadcrumb active.
|
||||
* Decide if the Source option should be visible depending on third party plugins.
|
||||
*
|
||||
* @return boolean True - If the option should be displayed, False - If the option should be hidden.
|
||||
*/
|
||||
public function is_third_party_breadcrumb_active() {
|
||||
|
||||
// Check if breadcrumb is turned on from WPSEO option.
|
||||
$breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false;
|
||||
$wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable;
|
||||
if ( ! is_array( $wpseo_option ) ) {
|
||||
unset( $wpseo_option );
|
||||
$wpseo_option = array(
|
||||
'breadcrumbs-enable' => $breadcrumb_enable,
|
||||
);
|
||||
}
|
||||
|
||||
if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] ) {
|
||||
// Check if breadcrumb is turned on from SEO Yoast plugin.
|
||||
return true;
|
||||
} elseif ( function_exists( 'bcn_display' ) ) {
|
||||
// Check if breadcrumb is turned on from Breadcrumb NavXT plugin.
|
||||
return true;
|
||||
} elseif ( function_exists( 'rank_math_the_breadcrumbs' ) ) {
|
||||
// Check if breadcrumb is turned on from Rank Math plugin.
|
||||
return true;
|
||||
} elseif ( function_exists( 'seopress_display_breadcrumbs' ) ) {
|
||||
// Check if breadcrumb is turned on from SEOPress plugin.
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Is selected third-party breadcrumb active.
|
||||
* Decide if the Separator option should be visible depending on third party plugins.
|
||||
*
|
||||
* @return boolean True - If the option should be displayed, False - If the option should be hidden.
|
||||
*/
|
||||
public function is_selected_breadcrumb_active() {
|
||||
|
||||
// Check if breadcrumb is turned on from WPSEO option.
|
||||
$selected_breadcrumb_source = astra_get_option( 'select-breadcrumb-source' );
|
||||
$breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false;
|
||||
$wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable;
|
||||
if ( ! is_array( $wpseo_option ) ) {
|
||||
|
||||
unset( $wpseo_option );
|
||||
$wpseo_option = array(
|
||||
'breadcrumbs-enable' => $breadcrumb_enable,
|
||||
);
|
||||
}
|
||||
|
||||
if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] && 'yoast-seo-breadcrumbs' === $selected_breadcrumb_source ) {
|
||||
// Check if breadcrumb is turned on from SEO Yoast plugin.
|
||||
return false;
|
||||
} elseif ( function_exists( 'bcn_display' ) && 'breadcrumb-navxt' === $selected_breadcrumb_source ) {
|
||||
// Check if breadcrumb is turned on from Breadcrumb NavXT plugin.
|
||||
return false;
|
||||
} elseif ( function_exists( 'rank_math_the_breadcrumbs' ) && 'rank-math' === $selected_breadcrumb_source ) {
|
||||
// Check if breadcrumb is turned on from Rank Math plugin.
|
||||
return false;
|
||||
} elseif ( function_exists( 'seopress_display_breadcrumbs' ) ) {
|
||||
// Check if breadcrumb is turned on from SEOPress plugin.
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Breadcrumbs_Configs();
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
/**
|
||||
* Typography - Breadcrumbs Options for theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://www.brainstormforce.com
|
||||
* @since Astra 1.7.0
|
||||
*/
|
||||
|
||||
// Block direct access to the file.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Bail if Customizer config base class does not exist.
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes
|
||||
*
|
||||
* @since 1.7.0
|
||||
*/
|
||||
if ( ! class_exists( 'Astra_Breadcrumbs_Typo_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Colors and Background - Breadcrumbs Options Customizer Configurations.
|
||||
*/
|
||||
class Astra_Breadcrumbs_Typo_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Colors and Background - Breadcrumbs Options Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.7.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/*
|
||||
* Breadcrumb Typography
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
|
||||
'default' => astra_get_option( 'section-breadcrumb-typo' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => esc_html__( 'Content Font', 'astra' ),
|
||||
'section' => 'section-breadcrumb',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 71,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
|
||||
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => 'breadcrumb-font-family',
|
||||
'default' => astra_get_option( 'breadcrumb-font-family' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
|
||||
'section' => 'section-breadcrumb',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'title' => esc_html__( 'Font Family', 'astra' ),
|
||||
'connect' => 'breadcrumb-font-weight',
|
||||
'priority' => 5,
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Font Weight
|
||||
*/
|
||||
array(
|
||||
'name' => 'breadcrumb-font-weight',
|
||||
'control' => 'ast-font',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
|
||||
'section' => 'section-breadcrumb',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'default' => astra_get_option( 'breadcrumb-font-weight' ),
|
||||
'title' => esc_html__( 'Font Weight', 'astra' ),
|
||||
'connect' => 'breadcrumb-font-family',
|
||||
'priority' => 10,
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Font Size
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => 'breadcrumb-font-size',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => 'section-breadcrumb',
|
||||
'transport' => 'postMessage',
|
||||
'title' => esc_html__( 'Font Size', 'astra' ),
|
||||
'priority' => 10,
|
||||
'default' => astra_get_option( 'breadcrumb-font-size' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Breadcrumb Content Font Extras
|
||||
*/
|
||||
array(
|
||||
'name' => 'breadcrumb-font-extras',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
|
||||
'control' => 'ast-font-extras',
|
||||
'section' => 'section-breadcrumb',
|
||||
'priority' => 25,
|
||||
'default' => astra_get_option( 'breadcrumb-font-extras' ),
|
||||
'title' => esc_html__( 'Line Height', 'astra' ),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
new Astra_Breadcrumbs_Typo_Configs();
|
||||
@@ -0,0 +1,582 @@
|
||||
<?php
|
||||
/**
|
||||
* Breadcrumbs - Dynamic CSS
|
||||
*
|
||||
* @package Astra
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Breadcrumbs
|
||||
*/
|
||||
add_filter( 'astra_dynamic_theme_css', 'astra_breadcrumb_section_dynamic_css' );
|
||||
|
||||
/**
|
||||
* Dynamic CSS
|
||||
*
|
||||
* @param string $dynamic_css Astra Dynamic CSS.
|
||||
* @param string $dynamic_css_filtered Astra Dynamic CSS Filters.
|
||||
* @return String Generated dynamic CSS for Breadcrumb.
|
||||
*
|
||||
* @since 1.7.0
|
||||
*/
|
||||
function astra_breadcrumb_section_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
|
||||
|
||||
$breadcrumb_position = astra_get_option( 'breadcrumb-position', 'none' );
|
||||
|
||||
$dynamic_css .= astra_parse_css(
|
||||
array(
|
||||
'.ast-breadcrumbs .trail-browse, .ast-breadcrumbs .trail-items, .ast-breadcrumbs .trail-items li' => array(
|
||||
'display' => 'inline-block',
|
||||
'margin' => '0',
|
||||
'padding' => '0',
|
||||
'border' => 'none',
|
||||
'background' => 'inherit',
|
||||
'text-indent' => '0',
|
||||
'text-decoration' => 'none',
|
||||
),
|
||||
'.ast-breadcrumbs .trail-browse' => array(
|
||||
'font-size' => 'inherit',
|
||||
'font-style' => 'inherit',
|
||||
'font-weight' => 'inherit',
|
||||
'color' => 'inherit',
|
||||
),
|
||||
'.ast-breadcrumbs .trail-items' => array(
|
||||
'list-style' => 'none',
|
||||
),
|
||||
'.trail-items li::after' => array(
|
||||
'padding' => '0 0.3em',
|
||||
'content' => '"\00bb"',
|
||||
),
|
||||
'.trail-items li:last-of-type::after' => array(
|
||||
'display' => 'none',
|
||||
),
|
||||
),
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
if ( 'none' === $breadcrumb_position ) {
|
||||
return $dynamic_css;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set CSS Params
|
||||
*/
|
||||
|
||||
$default_color_array = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$breadcrumb_text_color = astra_get_option( 'breadcrumb-text-color-responsive', $default_color_array );
|
||||
$breadcrumb_active_color = astra_get_option( 'breadcrumb-active-color-responsive', $default_color_array );
|
||||
$breadcrumb_hover_color = astra_get_option( 'breadcrumb-hover-color-responsive', $default_color_array );
|
||||
$breadcrumb_separator_color = astra_get_option( 'breadcrumb-separator-color', $default_color_array );
|
||||
$breadcrumb_bg_color = astra_get_option( 'breadcrumb-bg-color', $default_color_array );
|
||||
|
||||
$breadcrumb_font_size = astra_get_option( 'breadcrumb-font-size' );
|
||||
$breadcrumb_spacing = astra_get_option( 'breadcrumb-spacing' );
|
||||
$breadcrumb_alignment = astra_get_option( 'breadcrumb-alignment' );
|
||||
$breadcrumb_separator = astra_get_option( 'breadcrumb-separator' );
|
||||
$breadcrumb_separator_selector = astra_get_option( 'breadcrumb-separator-selector' );
|
||||
|
||||
/**
|
||||
* Generate dynamic CSS based on the Breadcrumb Source option selected from the customizer.
|
||||
*/
|
||||
$breadcrumb_source = astra_get_option( 'select-breadcrumb-source' );
|
||||
|
||||
/**
|
||||
* Generate Dynamic CSS
|
||||
*/
|
||||
|
||||
$css = '';
|
||||
$breadcrumbs_default_css = array();
|
||||
$breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false;
|
||||
$wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable;
|
||||
if ( ! is_array( $wpseo_option ) ) {
|
||||
unset( $wpseo_option );
|
||||
$wpseo_option = array(
|
||||
'breadcrumbs-enable' => $breadcrumb_enable,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Breadcrumb Separator
|
||||
*/
|
||||
$current_selected_separator = '';
|
||||
|
||||
if ( 'unicode' === $breadcrumb_separator_selector ) {
|
||||
$current_selected_separator = $breadcrumb_separator;
|
||||
} else {
|
||||
$current_selected_separator = $breadcrumb_separator_selector;
|
||||
}
|
||||
|
||||
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
'.trail-items li::after' => array(
|
||||
'content' => '"' . $current_selected_separator . '"',
|
||||
),
|
||||
),
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
/**
|
||||
* Breadcrumb Colors & Typography
|
||||
*/
|
||||
if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] && $breadcrumb_source && 'yoast-seo-breadcrumbs' == $breadcrumb_source ) {
|
||||
|
||||
/* Yoast SEO Breadcrumb CSS - Desktop */
|
||||
$breadcrumbs_desktop = array(
|
||||
'.ast-breadcrumbs-wrapper a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .breadcrumb_last' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper span' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
|
||||
),
|
||||
|
||||
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
|
||||
);
|
||||
|
||||
/* Yoast SEO Breadcrumb CSS - Tablet */
|
||||
$breadcrumbs_tablet = array(
|
||||
'.ast-breadcrumbs-wrapper a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .breadcrumb_last' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper span' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
|
||||
),
|
||||
|
||||
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => array(
|
||||
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
|
||||
),
|
||||
);
|
||||
|
||||
/* Yoast SEO Breadcrumb CSS - Mobile */
|
||||
$breadcrumbs_mobile = array(
|
||||
'.ast-breadcrumbs-wrapper a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .breadcrumb_last' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper span' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
|
||||
),
|
||||
|
||||
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => array(
|
||||
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
|
||||
),
|
||||
);
|
||||
} elseif ( function_exists( 'bcn_display' ) && $breadcrumb_source && 'breadcrumb-navxt' == $breadcrumb_source ) {
|
||||
|
||||
/* Breadcrumb NavXT CSS - Desktop */
|
||||
$breadcrumbs_desktop = array(
|
||||
'.ast-breadcrumbs-wrapper a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .current-item' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .breadcrumbs' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
|
||||
),
|
||||
|
||||
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
|
||||
);
|
||||
|
||||
/* Breadcrumb NavXT CSS - Tablet */
|
||||
$breadcrumbs_tablet = array(
|
||||
'.ast-breadcrumbs-wrapper a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .current-item' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .breadcrumbs' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
|
||||
),
|
||||
|
||||
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => array(
|
||||
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
|
||||
),
|
||||
);
|
||||
|
||||
/* Breadcrumb NavXT CSS - Mobile */
|
||||
$breadcrumbs_mobile = array(
|
||||
'.ast-breadcrumbs-wrapper a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .current-item' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .breadcrumbs' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
|
||||
),
|
||||
|
||||
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => array(
|
||||
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
|
||||
),
|
||||
);
|
||||
} elseif ( function_exists( 'rank_math_the_breadcrumbs' ) && $breadcrumb_source && 'rank-math' == $breadcrumb_source ) {
|
||||
|
||||
/* Rank Math CSS - Desktop */
|
||||
$breadcrumbs_desktop = array(
|
||||
'.ast-breadcrumbs-wrapper a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .last' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .separator' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
|
||||
),
|
||||
|
||||
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
|
||||
);
|
||||
|
||||
/* Rank Math CSS - Tablet */
|
||||
$breadcrumbs_tablet = array(
|
||||
'.ast-breadcrumbs-wrapper a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .last' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .separator' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
|
||||
),
|
||||
|
||||
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => array(
|
||||
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
|
||||
),
|
||||
);
|
||||
|
||||
/* Rank Math CSS - Mobile */
|
||||
$breadcrumbs_mobile = array(
|
||||
'.ast-breadcrumbs-wrapper a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .last' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .separator' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
|
||||
),
|
||||
|
||||
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => array(
|
||||
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
|
||||
),
|
||||
);
|
||||
} elseif ( function_exists( 'seopress_display_breadcrumbs' ) && $breadcrumb_source && 'seopress' == $breadcrumb_source ) {
|
||||
|
||||
/* SEOPress CSS - Desktop */
|
||||
$breadcrumbs_desktop = array(
|
||||
'.ast-breadcrumbs-inner .breadcrumb-item a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item.active' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-inner .breadcrumb-item a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-inner .breadcrumb-item:after' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item, .ast-breadcrumbs-inner .breadcrumb-item.active, .ast-breadcrumbs-inner .breadcrumb-item:after' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
|
||||
);
|
||||
|
||||
/* SEOPress CSS - Tablet */
|
||||
$breadcrumbs_tablet = array(
|
||||
'.ast-breadcrumbs-inner .breadcrumb-item a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item.active' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-inner .breadcrumb-item a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-inner .breadcrumb-item:after' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item, .ast-breadcrumbs-inner .breadcrumb-item.active, .ast-breadcrumbs-inner .breadcrumb-item:after' => array(
|
||||
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
|
||||
),
|
||||
);
|
||||
|
||||
/* SEOPress CSS - Mobile */
|
||||
$breadcrumbs_mobile = array(
|
||||
'.ast-breadcrumbs-inner .breadcrumb-item a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item.active' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-inner .breadcrumb-item a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-inner .breadcrumb-item:after' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item, .ast-breadcrumbs-inner .breadcrumb-item.active, .ast-breadcrumbs-inner .breadcrumb-item:after' => array(
|
||||
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
|
||||
/* Default Breadcrumb CSS - Desktop */
|
||||
$breadcrumbs_desktop = array(
|
||||
'.ast-breadcrumbs-wrapper .trail-items a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .trail-items .trail-end' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .trail-items a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .trail-items li::after' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
|
||||
),
|
||||
|
||||
'.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper *' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
|
||||
);
|
||||
|
||||
/* Default Breadcrumb CSS - Tablet */
|
||||
$breadcrumbs_tablet = array(
|
||||
'.ast-breadcrumbs-wrapper .trail-items a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .trail-items .trail-end' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .trail-items a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .trail-items li::after' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
|
||||
),
|
||||
|
||||
'.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper a' => array(
|
||||
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
|
||||
),
|
||||
);
|
||||
|
||||
/* Default Breadcrumb CSS - Mobile */
|
||||
$breadcrumbs_mobile = array(
|
||||
'.ast-breadcrumbs-wrapper .trail-items a' => array(
|
||||
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .trail-items .trail-end' => array(
|
||||
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
|
||||
),
|
||||
'.ast-breadcrumbs-wrapper .trail-items a:hover' => array(
|
||||
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
|
||||
),
|
||||
|
||||
'.ast-breadcrumbs-wrapper .trail-items li::after' => array(
|
||||
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
|
||||
),
|
||||
|
||||
'.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper a' => array(
|
||||
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/* Breadcrumb CSS for Background Color */
|
||||
$breadcrumbs_desktop['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array(
|
||||
'background-color' => esc_attr( $breadcrumb_bg_color['desktop'] ),
|
||||
);
|
||||
$breadcrumbs_tablet['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array(
|
||||
'background-color' => esc_attr( $breadcrumb_bg_color['tablet'] ),
|
||||
);
|
||||
$breadcrumbs_mobile['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array(
|
||||
'background-color' => esc_attr( $breadcrumb_bg_color['mobile'] ),
|
||||
);
|
||||
|
||||
/* Breadcrumb CSS for Spacing */
|
||||
if ( 'astra_header_markup_after' === $breadcrumb_position || 'astra_header_after' === $breadcrumb_position ) {
|
||||
// After Header.
|
||||
$breadcrumbs_desktop['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array(
|
||||
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ),
|
||||
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ),
|
||||
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ),
|
||||
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ),
|
||||
);
|
||||
$breadcrumbs_tablet['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array(
|
||||
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ),
|
||||
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ),
|
||||
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ),
|
||||
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ),
|
||||
);
|
||||
$breadcrumbs_mobile['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array(
|
||||
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ),
|
||||
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ),
|
||||
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ),
|
||||
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ),
|
||||
);
|
||||
$breadcrumbs_default_css['.ast-header-breadcrumb'] = array(
|
||||
'padding-top' => '10px',
|
||||
'padding-bottom' => '10px',
|
||||
'width' => '100%',
|
||||
);
|
||||
} elseif ( 'astra_masthead_content' === $breadcrumb_position ) {
|
||||
// Inside Header.
|
||||
$breadcrumbs_desktop['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
|
||||
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ),
|
||||
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ),
|
||||
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ),
|
||||
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ),
|
||||
);
|
||||
$breadcrumbs_tablet['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
|
||||
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ),
|
||||
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ),
|
||||
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ),
|
||||
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ),
|
||||
);
|
||||
$breadcrumbs_mobile['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
|
||||
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ),
|
||||
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ),
|
||||
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ),
|
||||
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ),
|
||||
);
|
||||
$breadcrumbs_default_css['.ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
|
||||
'padding-bottom' => '10px',
|
||||
);
|
||||
$breadcrumbs_default_css['.ast-header-break-point .ast-breadcrumbs-wrapper'] = array(
|
||||
'order' => '4',
|
||||
);
|
||||
} else {
|
||||
// Before Title.
|
||||
$breadcrumbs_desktop['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
|
||||
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ),
|
||||
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ),
|
||||
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ),
|
||||
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ),
|
||||
);
|
||||
$breadcrumbs_tablet['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
|
||||
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ),
|
||||
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ),
|
||||
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ),
|
||||
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ),
|
||||
);
|
||||
$breadcrumbs_mobile['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
|
||||
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ),
|
||||
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ),
|
||||
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ),
|
||||
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ),
|
||||
);
|
||||
}
|
||||
|
||||
/* Breadcrumb CSS for Alignment */
|
||||
$breadcrumbs_desktop['.ast-breadcrumbs-wrapper'] = array(
|
||||
'text-align' => esc_attr( $breadcrumb_alignment ),
|
||||
);
|
||||
|
||||
|
||||
$css .= astra_parse_css( $breadcrumbs_desktop );
|
||||
$css .= astra_parse_css( $breadcrumbs_tablet, '', astra_get_tablet_breakpoint() );
|
||||
$css .= astra_parse_css( $breadcrumbs_mobile, '', astra_get_mobile_breakpoint() );
|
||||
$css .= astra_parse_css( $breadcrumbs_default_css );
|
||||
|
||||
/* Breadcrumb default CSS */
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
'.ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar.ast-header-breadcrumb' => array(
|
||||
'padding-top' => '1em',
|
||||
'padding-bottom' => '1em',
|
||||
),
|
||||
),
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
'.ast-header-break-point .main-header-bar.ast-header-breadcrumb' => array(
|
||||
'border-bottom-width' => '1px',
|
||||
'border-bottom-color' => '#eaeaea',
|
||||
'border-bottom-style' => 'solid',
|
||||
),
|
||||
),
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
'.ast-breadcrumbs-wrapper' => array(
|
||||
'line-height' => '1.4',
|
||||
),
|
||||
),
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
'.ast-breadcrumbs-wrapper .rank-math-breadcrumb p' => array(
|
||||
'margin-bottom' => '0px',
|
||||
),
|
||||
),
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
'.ast-breadcrumbs-wrapper' => array(
|
||||
'display' => 'block',
|
||||
'width' => '100%',
|
||||
),
|
||||
),
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
$dynamic_css .= $css;
|
||||
|
||||
return $dynamic_css;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,151 @@
|
||||
/**
|
||||
* This file adds some LIVE to the Customizer live preview. To leverage
|
||||
* this, set your custom settings to 'postMessage' and then add your handling
|
||||
* here. Your javascript should grab settings from customizer controls, and
|
||||
* then make any necessary changes to the page using jQuery.
|
||||
*
|
||||
* @package Astra
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
( function( $ ) {
|
||||
|
||||
var headingSelectors = 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6';
|
||||
|
||||
if( astraHeadingColorOptions.maybeApplyHeadingColorForTitle ) {
|
||||
headingSelectors += ',.ast-archive-title, .entry-title a';
|
||||
}
|
||||
|
||||
/**
|
||||
* Content <h1> to <h6> headings
|
||||
*/
|
||||
astra_css( 'astra-settings[heading-base-color]', 'color', headingSelectors );
|
||||
|
||||
|
||||
function headingDynamicCss(slug) {
|
||||
let anchorSupport = '';
|
||||
let WidthTitleSupport = '';
|
||||
|
||||
// Check if anchors should be loaded in the CSS for headings.
|
||||
if( astraCustomizer.includeAnchorsInHeadindsCss ) {
|
||||
anchorSupport = ',.entry-content ' + slug + ' a';
|
||||
}
|
||||
|
||||
// Add widget title support to font-weight preview CSS.
|
||||
if( astraCustomizer.font_weights_widget_title_support ) {
|
||||
WidthTitleSupport = ',' + slug + '.widget-title';
|
||||
}
|
||||
|
||||
astra_generate_outside_font_family_css( 'astra-settings[font-family-'+ slug +']', slug + ', .entry-content ' + slug + anchorSupport, true, '.ast-sg-typo-field[data-for="' + slug + '"] .ast-sg-font-family' );
|
||||
astra_generate_font_weight_css( 'astra-settings[font-family-'+ slug +']', 'astra-settings[font-weight-'+ slug +']', 'font-weight', slug + ', .entry-content ' + slug + anchorSupport + WidthTitleSupport );
|
||||
|
||||
wp.customize( 'astra-settings[font-extras-'+ slug +']', function( value ) {
|
||||
|
||||
value.bind( function( data ) {
|
||||
let elementorSupport = '';
|
||||
let dynamicStyle = '';
|
||||
|
||||
if ( astraCustomizer.page_builder_button_style_css ) {
|
||||
elementorSupport = ',.elementor-widget-heading '+ slug +'.elementor-heading-title';
|
||||
}
|
||||
|
||||
// Line Height
|
||||
const globalSelectorLineHeight = slug + ', .entry-content '+ slug + elementorSupport + anchorSupport;
|
||||
|
||||
if( data['line-height'] && data['line-height-unit'] ) {
|
||||
dynamicStyle += globalSelectorLineHeight + '{';
|
||||
dynamicStyle += 'line-height : ' + data['line-height'] + data['line-height-unit'] + ';' ;
|
||||
dynamicStyle += '}';
|
||||
|
||||
let styleGuideUpdatedEvent = new CustomEvent('AstraStyleGuideElementUpdated', {
|
||||
'detail': {
|
||||
'value': data['line-height'] + data['line-height-unit'],
|
||||
'selector': '.ast-sg-typo-field[data-for="' + slug + '"] .ast-sg-line-height'
|
||||
}
|
||||
});
|
||||
document.dispatchEvent(styleGuideUpdatedEvent);
|
||||
}
|
||||
|
||||
const globalSelector = slug +', .entry-content ' + slug + anchorSupport;
|
||||
|
||||
if( data['letter-spacing'] || data['text-decoration'] || data['text-transform'] ) {
|
||||
dynamicStyle += globalSelector + '{';
|
||||
if( data['letter-spacing'] && data['letter-spacing-unit'] ) {
|
||||
dynamicStyle += 'letter-spacing : ' + data['letter-spacing'] + data['letter-spacing-unit'] + ";" ;
|
||||
}
|
||||
if( data['text-decoration'] ) {
|
||||
dynamicStyle += 'text-decoration : ' + data['text-decoration'] + ";";
|
||||
}
|
||||
if( data['text-transform'] ) {
|
||||
dynamicStyle += 'text-transform : ' + data['text-transform'] + ';' ;
|
||||
}
|
||||
|
||||
dynamicStyle += '}';
|
||||
}
|
||||
astra_add_dynamic_css( 'font-extras-'+ slug, dynamicStyle );
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
headingDynamicCss('h1');
|
||||
headingDynamicCss('h2');
|
||||
headingDynamicCss('h3');
|
||||
headingDynamicCss('h4');
|
||||
headingDynamicCss('h5');
|
||||
headingDynamicCss('h6');
|
||||
|
||||
let woo_button_attr = '';
|
||||
|
||||
// WooCommerce global button compatibility for new users only.
|
||||
if( astraCustomizer.astra_woo_btn_global_compatibility ) {
|
||||
woo_button_attr = ', .woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce-cart table.cart td.actions .button, .woocommerce form.checkout_coupon .button, .woocommerce #respond input#submit, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link';
|
||||
}
|
||||
|
||||
if ( astraCustomizer.page_builder_button_style_css ) {
|
||||
|
||||
var ele_btn_font_family = '';
|
||||
var ele_btn_font_weight = '';
|
||||
var ele_btn_font_size = '';
|
||||
var ele_btn_transform = '';
|
||||
var ele_btn_line_height = '';
|
||||
var ele_btn_letter_spacing = '';
|
||||
|
||||
if ( 'color-typo' == astraCustomizer.elementor_default_color_font_setting || 'typo' == astraCustomizer.elementor_default_color_font_setting ) {
|
||||
// Button Typo
|
||||
ele_btn_font_family = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited';
|
||||
ele_btn_font_weight = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited';
|
||||
ele_btn_font_size = ',.elementor-button-wrapper .elementor-button.elementor-size-sm, .elementor-button-wrapper .elementor-button.elementor-size-xs, .elementor-button-wrapper .elementor-button.elementor-size-md, .elementor-button-wrapper .elementor-button.elementor-size-lg, .elementor-button-wrapper .elementor-button.elementor-size-xl, .elementor-button-wrapper .elementor-button';
|
||||
ele_btn_transform = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited';
|
||||
ele_btn_line_height = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited';
|
||||
ele_btn_letter_spacing = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited', 'px';
|
||||
}
|
||||
// Button Typo
|
||||
astra_generate_outside_font_family_css( 'astra-settings[font-family-button]', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' + astraCustomizer.v4_2_2_core_form_btns_styling + ele_btn_font_family + woo_button_attr );
|
||||
astra_generate_font_weight_css( 'astra-settings[font-family-button]', 'astra-settings[font-weight-button]', 'font-weight', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' + astraCustomizer.v4_2_2_core_form_btns_styling + ele_btn_font_weight + woo_button_attr );
|
||||
astra_font_extras_css( 'font-extras-button', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], body .wp-block-button .wp-block-button__link, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' + astraCustomizer.v4_2_2_core_form_btns_styling + ele_btn_transform + woo_button_attr + astraCustomizer.improved_button_selector );
|
||||
|
||||
astra_responsive_font_size( 'astra-settings[font-size-button]', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' + astraCustomizer.v4_2_2_core_form_btns_styling + ele_btn_font_size + woo_button_attr );
|
||||
astra_css( 'astra-settings[theme-btn-line-height]', 'line-height', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' + astraCustomizer.v4_2_2_core_form_btns_styling + ele_btn_line_height + woo_button_attr );
|
||||
astra_css( 'astra-settings[theme-btn-letter-spacing]', 'letter-spacing', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' + astraCustomizer.v4_2_2_core_form_btns_styling + ele_btn_letter_spacing + woo_button_attr, 'px' );
|
||||
|
||||
} else {
|
||||
// Button Typo
|
||||
astra_generate_outside_font_family_css( 'astra-settings[font-family-button]', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + astraCustomizer.v4_2_2_core_form_btns_styling + woo_button_attr );
|
||||
astra_generate_font_weight_css( 'astra-settings[font-family-button]', 'astra-settings[font-weight-button]', 'font-weight', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + astraCustomizer.v4_2_2_core_form_btns_styling + woo_button_attr );
|
||||
astra_font_extras_css( 'font-extras-button', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + astraCustomizer.v4_2_2_core_form_btns_styling + woo_button_attr );
|
||||
astra_responsive_font_size( 'astra-settings[font-size-button]', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + astraCustomizer.v4_2_2_core_form_btns_styling + woo_button_attr );
|
||||
astra_css( 'astra-settings[theme-btn-line-height]', 'line-height', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + astraCustomizer.v4_2_2_core_form_btns_styling + woo_button_attr );
|
||||
astra_css( 'astra-settings[theme-btn-letter-spacing]', 'letter-spacing', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + astraCustomizer.v4_2_2_core_form_btns_styling + woo_button_attr , 'px' );
|
||||
}
|
||||
|
||||
// Secondary button typo.
|
||||
let outline_btn_selector = 'body .wp-block-buttons .wp-block-button.is-style-outline .wp-block-button__link.wp-element-button, body .ast-outline-button, body .wp-block-uagb-buttons-child .uagb-buttons-repeater.ast-outline-button';
|
||||
astra_generate_outside_font_family_css( 'astra-settings[secondary-font-family-button]', outline_btn_selector );
|
||||
astra_generate_font_weight_css( 'astra-settings[secondary-font-family-button]', 'astra-settings[secondary-font-weight-button]', 'font-weight', outline_btn_selector );
|
||||
astra_font_extras_css( 'secondary-font-extras-button', outline_btn_selector );
|
||||
astra_responsive_font_size( 'astra-settings[secondary-font-size-button]', outline_btn_selector );
|
||||
astra_css( 'astra-settings[secondary-theme-btn-line-height]', 'line-height', outline_btn_selector );
|
||||
astra_css( 'astra-settings[secondary-theme-btn-letter-spacing]', 'letter-spacing', outline_btn_selector, 'px' );
|
||||
|
||||
} )( jQuery );
|
||||
@@ -0,0 +1,271 @@
|
||||
<?php
|
||||
/**
|
||||
* Heading Colors Loader for Astra theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://www.brainstormforce.com
|
||||
* @since Astra 2.2.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Initialization
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
class Astra_Heading_Colors_Loader {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
|
||||
add_action( 'customize_register', array( $this, 'customize_register' ), 2 );
|
||||
add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 );
|
||||
// Load Google fonts.
|
||||
add_action( 'astra_get_fonts', array( $this, 'add_fonts' ), 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue google fonts.
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public function add_fonts() {
|
||||
|
||||
$font_family_h1 = astra_get_option( 'font-family-h1' );
|
||||
$font_weight_h1 = astra_get_option( 'font-weight-h1' );
|
||||
Astra_Fonts::add_font( $font_family_h1, $font_weight_h1 );
|
||||
|
||||
$font_family_h2 = astra_get_option( 'font-family-h2' );
|
||||
$font_weight_h2 = astra_get_option( 'font-weight-h2' );
|
||||
Astra_Fonts::add_font( $font_family_h2, $font_weight_h2 );
|
||||
|
||||
$font_family_h3 = astra_get_option( 'font-family-h3' );
|
||||
$font_weight_h3 = astra_get_option( 'font-weight-h3' );
|
||||
Astra_Fonts::add_font( $font_family_h3, $font_weight_h3 );
|
||||
|
||||
if ( astra_has_gcp_typo_preset_compatibility() ) {
|
||||
|
||||
$font_family_h4 = astra_get_option( 'font-family-h4' );
|
||||
$font_weight_h4 = astra_get_option( 'font-weight-h4' );
|
||||
Astra_Fonts::add_font( $font_family_h4, $font_weight_h4 );
|
||||
|
||||
$font_family_h5 = astra_get_option( 'font-family-h5' );
|
||||
$font_weight_h5 = astra_get_option( 'font-weight-h5' );
|
||||
Astra_Fonts::add_font( $font_family_h5, $font_weight_h5 );
|
||||
|
||||
$font_family_h6 = astra_get_option( 'font-family-h6' );
|
||||
$font_weight_h6 = astra_get_option( 'font-weight-h6' );
|
||||
Astra_Fonts::add_font( $font_family_h6, $font_weight_h6 );
|
||||
|
||||
}
|
||||
|
||||
$theme_btn_font_family = astra_get_option( 'font-family-button' );
|
||||
$theme_btn_font_weight = astra_get_option( 'font-weight-button' );
|
||||
Astra_Fonts::add_font( $theme_btn_font_family, $theme_btn_font_weight );
|
||||
|
||||
$theme_secondary_btn_font_family = astra_get_option( 'secondary-font-family-button' );
|
||||
$theme_secondary_btn_font_weight = astra_get_option( 'secondary-font-weight-button' );
|
||||
Astra_Fonts::add_font( $theme_secondary_btn_font_family, $theme_secondary_btn_font_weight );
|
||||
|
||||
$header_btn_font_family = astra_get_option( 'primary-header-button-font-family' );
|
||||
$header_btn_font_weight = astra_get_option( 'primary-header-button-font-weight' );
|
||||
Astra_Fonts::add_font( $header_btn_font_family, $header_btn_font_weight );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Options Default Values
|
||||
*
|
||||
* @param array $defaults Astra options default value array.
|
||||
* @return array
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public function theme_defaults( $defaults ) {
|
||||
|
||||
$astra_options = Astra_Theme_Options::get_astra_options();
|
||||
/**
|
||||
* Update Astra default color and typography values. To not update directly on existing users site, added backwards.
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
$apply_new_default_color_typo_values = Astra_Dynamic_CSS::astra_check_default_color_typo();
|
||||
|
||||
/**
|
||||
* Heading Tags <h1> to <h6>
|
||||
*/
|
||||
$defaults['h1-color'] = '';
|
||||
$defaults['h2-color'] = '';
|
||||
$defaults['h3-color'] = '';
|
||||
$defaults['h4-color'] = '';
|
||||
$defaults['h5-color'] = '';
|
||||
$defaults['h6-color'] = '';
|
||||
|
||||
// Header <H1>.
|
||||
$defaults['font-family-h1'] = 'inherit';
|
||||
$defaults['font-weight-h1'] = 'inherit';
|
||||
$defaults['font-extras-h1'] = array(
|
||||
'line-height' => ! isset( $astra_options['font-extras-h1'] ) && isset( $astra_options['line-height-h1'] ) ? $astra_options['line-height-h1'] : '1.4',
|
||||
'line-height-unit' => 'em',
|
||||
'letter-spacing' => '',
|
||||
'letter-spacing-unit' => 'px',
|
||||
'text-transform' => ! isset( $astra_options['font-extras-h1'] ) && isset( $astra_options['text-transform-h1'] ) ? $astra_options['text-transform-h1'] : '',
|
||||
'text-decoration' => '',
|
||||
);
|
||||
|
||||
// Header <H2>.
|
||||
$defaults['font-family-h2'] = 'inherit';
|
||||
$defaults['font-weight-h2'] = 'inherit';
|
||||
$defaults['font-extras-h2'] = array(
|
||||
'line-height' => ! isset( $astra_options['font-extras-h2'] ) && isset( $astra_options['line-height-h2'] ) ? $astra_options['line-height-h2'] : '1.3',
|
||||
'line-height-unit' => 'em',
|
||||
'letter-spacing' => '',
|
||||
'letter-spacing-unit' => 'px',
|
||||
'text-transform' => ! isset( $astra_options['font-extras-h2'] ) && isset( $astra_options['text-transform-h2'] ) ? $astra_options['text-transform-h2'] : '',
|
||||
'text-decoration' => '',
|
||||
);
|
||||
|
||||
// Header <H3>.
|
||||
$defaults['font-family-h3'] = 'inherit';
|
||||
$defaults['font-weight-h3'] = 'inherit';
|
||||
$defaults['font-extras-h3'] = array(
|
||||
'line-height' => ! isset( $astra_options['font-extras-h3'] ) && isset( $astra_options['line-height-h3'] ) ? $astra_options['line-height-h3'] : '1.3',
|
||||
'line-height-unit' => 'em',
|
||||
'letter-spacing' => '',
|
||||
'letter-spacing-unit' => 'px',
|
||||
'text-transform' => ! isset( $astra_options['font-extras-h3'] ) && isset( $astra_options['text-transform-h3'] ) ? $astra_options['text-transform-h3'] : '',
|
||||
'text-decoration' => '',
|
||||
);
|
||||
|
||||
// Header <H4>.
|
||||
$defaults['font-family-h4'] = 'inherit';
|
||||
$defaults['font-weight-h4'] = 'inherit';
|
||||
$defaults['font-extras-h4'] = array(
|
||||
'line-height' => ! isset( $astra_options['font-extras-h4'] ) && isset( $astra_options['line-height-h4'] ) ? $astra_options['line-height-h4'] : '1.2',
|
||||
'line-height-unit' => 'em',
|
||||
'letter-spacing' => '',
|
||||
'letter-spacing-unit' => 'px',
|
||||
'text-transform' => ! isset( $astra_options['font-extras-h4'] ) && isset( $astra_options['text-transform-h4'] ) ? $astra_options['text-transform-h4'] : '',
|
||||
'text-decoration' => '',
|
||||
);
|
||||
|
||||
// Header <H5>.
|
||||
$defaults['font-family-h5'] = 'inherit';
|
||||
$defaults['font-weight-h5'] = 'inherit';
|
||||
$defaults['font-extras-h5'] = array(
|
||||
'line-height' => ! isset( $astra_options['font-extras-h5'] ) && isset( $astra_options['line-height-h5'] ) ? $astra_options['line-height-h5'] : '1.2',
|
||||
'line-height-unit' => 'em',
|
||||
'letter-spacing' => '',
|
||||
'letter-spacing-unit' => 'px',
|
||||
'text-transform' => ! isset( $astra_options['font-extras-h5'] ) && isset( $astra_options['text-transform-h5'] ) ? $astra_options['text-transform-h5'] : '',
|
||||
'text-decoration' => '',
|
||||
);
|
||||
|
||||
// Header <H6>.
|
||||
$defaults['font-family-h6'] = 'inherit';
|
||||
$defaults['font-weight-h6'] = 'inherit';
|
||||
$defaults['font-extras-h6'] = array(
|
||||
'line-height' => ! isset( $astra_options['font-extras-h6'] ) && isset( $astra_options['line-height-h6'] ) ? $astra_options['line-height-h6'] : '1.25',
|
||||
'line-height-unit' => 'em',
|
||||
'letter-spacing' => '',
|
||||
'letter-spacing-unit' => 'px',
|
||||
'text-transform' => ! isset( $astra_options['font-extras-h6'] ) && isset( $astra_options['text-transform-h6'] ) ? $astra_options['text-transform-h6'] : '',
|
||||
'text-decoration' => '',
|
||||
);
|
||||
|
||||
/**
|
||||
* Theme button Font Defaults
|
||||
*/
|
||||
$defaults['font-weight-button'] = $apply_new_default_color_typo_values ? '500' : 'inherit';
|
||||
$defaults['secondary-font-weight-button'] = $apply_new_default_color_typo_values ? '500' : 'inherit';
|
||||
$defaults['font-family-button'] = 'inherit';
|
||||
$defaults['secondary-font-family-button'] = 'inherit';
|
||||
$defaults['font-size-button'] = array(
|
||||
'desktop' => $apply_new_default_color_typo_values ? '16' : '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
);
|
||||
$defaults['secondary-font-size-button'] = array(
|
||||
'desktop' => $apply_new_default_color_typo_values ? '16' : '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
);
|
||||
|
||||
$defaults['font-extras-button'] = array(
|
||||
'line-height' => ! isset( $astra_options['font-extras-button'] ) && isset( $astra_options['theme-btn-line-height'] ) ? $astra_options['theme-btn-line-height'] : 1,
|
||||
'line-height-unit' => 'em',
|
||||
'letter-spacing' => ! isset( $astra_options['font-extras-button'] ) && isset( $astra_options['theme-btn-letter-spacing'] ) ? $astra_options['theme-btn-letter-spacing'] : '',
|
||||
'letter-spacing-unit' => 'px',
|
||||
'text-transform' => ! isset( $astra_options['font-extras-button'] ) && isset( $astra_options['text-transform-button'] ) ? $astra_options['text-transform-button'] : '',
|
||||
'text-decoration' => '',
|
||||
);
|
||||
|
||||
$defaults['secondary-font-extras-button'] = array(
|
||||
'line-height' => ! isset( $astra_options['secondary-font-extras-button'] ) && isset( $astra_options['secondary-theme-btn-line-height'] ) ? $astra_options['secondary-theme-btn-line-height'] : 1,
|
||||
'line-height-unit' => 'em',
|
||||
'letter-spacing' => ! isset( $astra_options['secondary-font-extras-button'] ) && isset( $astra_options['secondary-theme-btn-letter-spacing'] ) ? $astra_options['secondary-theme-btn-letter-spacing'] : '',
|
||||
'letter-spacing-unit' => 'px',
|
||||
'text-transform' => ! isset( $astra_options['secondary-font-extras-button'] ) && isset( $astra_options['secondary-text-transform-button'] ) ? $astra_options['secondary-text-transform-button'] : '',
|
||||
'text-decoration' => '',
|
||||
);
|
||||
|
||||
return $defaults;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load color configs for the Heading Colors.
|
||||
*
|
||||
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public function customize_register( $wp_customize ) {
|
||||
|
||||
/**
|
||||
* Register Panel & Sections
|
||||
*/
|
||||
require_once ASTRA_THEME_HEADING_COLORS_DIR . 'customizer/class-astra-heading-colors-configs.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Preview
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public function preview_scripts() {
|
||||
/**
|
||||
* Load unminified if SCRIPT_DEBUG is true.
|
||||
*/
|
||||
/* Directory and Extension */
|
||||
$dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
|
||||
$file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
|
||||
wp_enqueue_script( 'astra-heading-colors-customizer-preview-js', ASTRA_THEME_HEADING_COLORS_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
|
||||
|
||||
wp_localize_script(
|
||||
'astra-heading-colors-customizer-preview-js',
|
||||
'astraHeadingColorOptions',
|
||||
array(
|
||||
'maybeApplyHeadingColorForTitle' => astra_has_global_color_format_support(),
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating the object of the class.
|
||||
*/
|
||||
new Astra_Heading_Colors_Loader();
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Heading Colors for Astra theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://www.brainstormforce.com
|
||||
* @since Astra 2.1.4
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
define( 'ASTRA_THEME_HEADING_COLORS_DIR', ASTRA_THEME_DIR . 'inc/addons/heading-colors/' );
|
||||
define( 'ASTRA_THEME_HEADING_COLORS_URI', ASTRA_THEME_URI . 'inc/addons/heading-colors/' );
|
||||
|
||||
if ( ! class_exists( 'Astra_Heading_Colors' ) ) {
|
||||
|
||||
/**
|
||||
* Heading Initial Setup
|
||||
*
|
||||
* @since 2.1.4
|
||||
*/
|
||||
class Astra_Heading_Colors {
|
||||
|
||||
/**
|
||||
* Constructor function that initializes required actions and hooks
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
require_once ASTRA_THEME_HEADING_COLORS_DIR . 'class-astra-heading-colors-loader.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
||||
|
||||
// Include front end files.
|
||||
if ( ! is_admin() ) {
|
||||
require_once ASTRA_THEME_HEADING_COLORS_DIR . 'dynamic-css/dynamic.css.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating an object.
|
||||
*/
|
||||
new Astra_Heading_Colors();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,266 @@
|
||||
<?php
|
||||
/**
|
||||
* Heading Colors Options for Astra theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://www.brainstormforce.com
|
||||
* @since Astra 2.1.4
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Heading_Colors_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes Initial setup
|
||||
*/
|
||||
class Astra_Heading_Colors_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Astra Heading Colors Settings.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 2.1.4
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_section = 'section-colors-background';
|
||||
|
||||
if ( class_exists( 'Astra_Ext_Extension' ) && Astra_Ext_Extension::is_active( 'colors-and-background' ) && ! astra_has_gcp_typo_preset_compatibility() ) {
|
||||
$_section = 'section-colors-body';
|
||||
}
|
||||
|
||||
$_configs = array(
|
||||
|
||||
// Option: Base Heading Color.
|
||||
array(
|
||||
'default' => astra_get_option( 'heading-base-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 5,
|
||||
'name' => ASTRA_THEME_SETTINGS . '[heading-base-color]',
|
||||
'title' => __( 'Heading (H1-H6)', 'astra' ),
|
||||
'section' => $_section,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Typography Heading
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[button-text-typography]',
|
||||
'default' => astra_get_option( 'button-text-typography' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Font', 'astra' ),
|
||||
'section' => 'section-buttons',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 18.5,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Outline Button Typography Heading
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[secondary-button-text-typography]',
|
||||
'default' => astra_get_option( 'secondary-button-text-typography' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Font', 'astra' ),
|
||||
'section' => 'section-buttons',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 10,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-family-button',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]',
|
||||
'section' => 'section-buttons',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'default' => astra_get_option( 'font-family-button' ),
|
||||
'connect' => ASTRA_THEME_SETTINGS . '[font-weight-button]',
|
||||
'priority' => 1,
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Outline Button Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => 'secondary-font-family-button',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[secondary-button-text-typography]',
|
||||
'section' => 'section-buttons',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'default' => astra_get_option( 'secondary-font-family-button' ),
|
||||
'connect' => ASTRA_THEME_SETTINGS . '[secondary-font-weight-button]',
|
||||
'priority' => 1,
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Font Weight
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-weight-button',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]',
|
||||
'section' => 'section-buttons',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'default' => astra_get_option( 'font-weight-button' ),
|
||||
'connect' => 'font-family-button',
|
||||
'priority' => 2,
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Font Weight
|
||||
*/
|
||||
array(
|
||||
'name' => 'secondary-font-weight-button',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[secondary-button-text-typography]',
|
||||
'section' => 'section-buttons',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'default' => astra_get_option( 'secondary-font-weight-button' ),
|
||||
'connect' => 'secondary-font-family-button',
|
||||
'priority' => 2,
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Font Size
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => 'font-size-button',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => 'section-buttons',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'priority' => 3,
|
||||
'default' => astra_get_option( 'font-size-button' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Outline Button Font Size
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => 'secondary-font-size-button',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[secondary-button-text-typography]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => 'section-buttons',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'priority' => 3,
|
||||
'default' => astra_get_option( 'secondary-font-size-button' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Font Extras
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-extras-button',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]',
|
||||
'control' => 'ast-font-extras',
|
||||
'section' => 'section-buttons',
|
||||
'priority' => 4,
|
||||
'default' => astra_get_option( 'font-extras-button' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Outline Button Font Extras
|
||||
*/
|
||||
array(
|
||||
'name' => 'secondary-font-extras-button',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[secondary-button-text-typography]',
|
||||
'control' => 'ast-font-extras',
|
||||
'section' => 'section-buttons',
|
||||
'priority' => 4,
|
||||
'default' => astra_get_option( 'secondary-font-extras-button' ),
|
||||
),
|
||||
);
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Heading_Colors_Configs();
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* Heading Colors - Dynamic CSS
|
||||
*
|
||||
* @package Astra
|
||||
* @since 2.1.4
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Heading Colors
|
||||
*/
|
||||
add_filter( 'astra_dynamic_theme_css', 'astra_heading_colors_section_dynamic_css' );
|
||||
|
||||
/**
|
||||
* Dynamic CSS
|
||||
*
|
||||
* @param string $dynamic_css Astra Dynamic CSS.
|
||||
* @param string $dynamic_css_filtered Astra Dynamic CSS Filters.
|
||||
* @return String Generated dynamic CSS for Heading Colors.
|
||||
*
|
||||
* @since 2.1.4
|
||||
*/
|
||||
function astra_heading_colors_section_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
|
||||
|
||||
/**
|
||||
* Heading Colors - h1 - h6.
|
||||
*/
|
||||
$heading_base_color = astra_get_option( 'heading-base-color' );
|
||||
|
||||
if ( empty( $heading_base_color ) ) {
|
||||
return $dynamic_css;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normal Colors without reponsive option.
|
||||
* [1]. Heading Colors
|
||||
*/
|
||||
$css_output = array(
|
||||
|
||||
/**
|
||||
* Content base heading color.
|
||||
*/
|
||||
'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6' => array(
|
||||
'color' => esc_attr( $heading_base_color ),
|
||||
),
|
||||
);
|
||||
|
||||
if ( astra_has_global_color_format_support() ) {
|
||||
$css_output['.entry-title a'] = array(
|
||||
'color' => esc_attr( $heading_base_color ),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/* Parse CSS from array() */
|
||||
$css_output = astra_parse_css( $css_output );
|
||||
|
||||
$dynamic_css .= $css_output;
|
||||
|
||||
return $dynamic_css;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
jQuery,astra_css("astra-settings[scroll-to-top-icon-size]","font-size","#ast-scroll-top","px"),astra_css("astra-settings[scroll-to-top-icon-color]","color","#ast-scroll-top"),astra_css("astra-settings[scroll-to-top-icon-bg-color]","background-color","#ast-scroll-top"),astra_css("astra-settings[scroll-to-top-icon-h-color]","color","#ast-scroll-top:hover"),astra_css("astra-settings[scroll-to-top-icon-h-bg-color]","background-color","#ast-scroll-top:hover"),wp.customize("astra-settings[scroll-to-top-icon-radius-fields]",function(t){t.bind(function(t){var o=astraBuilderPreview.tablet_break_point||768,s="",s=(s=(s+=" #ast-scroll-top { border-top-left-radius :"+t.desktop.top+t["desktop-unit"]+"; border-bottom-right-radius :"+t.desktop.bottom+t["desktop-unit"]+"; border-bottom-left-radius :"+t.desktop.left+t["desktop-unit"]+"; border-top-right-radius :"+t.desktop.right+t["desktop-unit"]+"; } ")+("@media (max-width: "+o+"px) { #ast-scroll-top { border-top-left-radius :"+t.tablet.top+t["tablet-unit"]+"; border-bottom-right-radius :"+t.tablet.bottom+t["tablet-unit"]+"; border-bottom-left-radius :"+t.tablet.left+t["tablet-unit"]+"; border-top-right-radius :"+t.tablet.right+t["tablet-unit"]+"; } }"))+("@media (max-width: "+(astraBuilderPreview.mobile_break_point||544)+"px) { #ast-scroll-top { border-top-left-radius :"+t.mobile.top+t["mobile-unit"]+"; border-bottom-right-radius :"+t.mobile.bottom+t["mobile-unit"]+"; border-bottom-left-radius :"+t.mobile.left+t["mobile-unit"]+"; border-top-right-radius :"+t.mobile.right+t["mobile-unit"]+"; } }");astra_add_dynamic_css("scroll-to-top-icon-radius-fields",s)})}),wp.customize("astra-settings[scroll-to-top-icon-position]",function(t){t.bind(function(t){jQuery("#ast-scroll-top").removeClass("ast-scroll-to-top-right ast-scroll-to-top-left"),jQuery("#ast-scroll-top").addClass("ast-scroll-to-top-"+t)})});
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* This file adds some LIVE to the Customizer live preview. To leverage
|
||||
* this, set your custom settings to 'postMessage' and then add your handling
|
||||
* here. Your javascript should grab settings from customizer controls, and
|
||||
* then make any necessary changes to the page using jQuery.
|
||||
*
|
||||
* @package Astra
|
||||
* @since x.x.x
|
||||
*/
|
||||
( function( $ ) {
|
||||
|
||||
astra_css(
|
||||
'astra-settings[scroll-to-top-icon-size]',
|
||||
'font-size',
|
||||
'#ast-scroll-top',
|
||||
'px'
|
||||
);
|
||||
astra_css( 'astra-settings[scroll-to-top-icon-color]', 'color', '#ast-scroll-top' );
|
||||
astra_css( 'astra-settings[scroll-to-top-icon-bg-color]', 'background-color', '#ast-scroll-top' );
|
||||
astra_css( 'astra-settings[scroll-to-top-icon-h-color]', 'color', '#ast-scroll-top:hover' );
|
||||
astra_css( 'astra-settings[scroll-to-top-icon-h-bg-color]', 'background-color', '#ast-scroll-top:hover' );
|
||||
|
||||
// Border Radius Fields for Button.
|
||||
wp.customize( 'astra-settings[scroll-to-top-icon-radius-fields]', function( value ) {
|
||||
value.bind( function( border ) {
|
||||
let tablet_break_point = astraBuilderPreview.tablet_break_point || 768,
|
||||
mobile_break_point = astraBuilderPreview.mobile_break_point || 544;
|
||||
let dynamicStyle = '';
|
||||
dynamicStyle += ' #ast-scroll-top { border-top-left-radius :' + border['desktop']['top'] + border['desktop-unit']
|
||||
+ '; border-bottom-right-radius :' + border['desktop']['bottom'] + border['desktop-unit'] + '; border-bottom-left-radius :'
|
||||
+ border['desktop']['left'] + border['desktop-unit'] + '; border-top-right-radius :' + border['desktop']['right'] + border['desktop-unit'] + '; } ';
|
||||
dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) { #ast-scroll-top { border-top-left-radius :' + border['tablet']['top'] + border['tablet-unit']
|
||||
+ '; border-bottom-right-radius :' + border['tablet']['bottom'] + border['tablet-unit'] + '; border-bottom-left-radius :'
|
||||
+ border['tablet']['left'] + border['tablet-unit'] + '; border-top-right-radius :' + border['tablet']['right'] + border['tablet-unit'] + '; } }';
|
||||
dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) { #ast-scroll-top { border-top-left-radius :' + border['mobile']['top'] + border['mobile-unit']
|
||||
+ '; border-bottom-right-radius :' + border['mobile']['bottom'] + border['mobile-unit'] + '; border-bottom-left-radius :'
|
||||
+ border['mobile']['left'] + border['mobile-unit'] + '; border-top-right-radius :' + border['mobile']['right'] + border['mobile-unit'] + '; } }';
|
||||
astra_add_dynamic_css( 'scroll-to-top-icon-radius-fields', dynamicStyle );
|
||||
} );
|
||||
} );
|
||||
|
||||
// Scroll to top position.
|
||||
wp.customize( 'astra-settings[scroll-to-top-icon-position]', function( value ) {
|
||||
value.bind( function( position ) {
|
||||
jQuery("#ast-scroll-top").removeClass("ast-scroll-to-top-right ast-scroll-to-top-left");
|
||||
jQuery("#ast-scroll-top").addClass("ast-scroll-to-top-"+position);
|
||||
} );
|
||||
} );
|
||||
|
||||
} )( jQuery );
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Scroll To Top
|
||||
*
|
||||
* @package Astra
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
var masthead = document.querySelector( '#page header' );
|
||||
var astScrollTop = document.getElementById( 'ast-scroll-top' );
|
||||
if ( astScrollTop ) {
|
||||
astScrollToTop = function () {
|
||||
|
||||
var content = getComputedStyle(astScrollTop).content,
|
||||
device = astScrollTop.dataset.onDevices;
|
||||
content = content.replace( /[^0-9]/g, '' );
|
||||
|
||||
if( 'both' == device || ( 'desktop' == device && '769' == content ) || ( 'mobile' == device && '' == content ) ) {
|
||||
|
||||
// Get current window / document scroll.
|
||||
var scrollTop = window.pageYOffset || document.body.scrollTop;
|
||||
// If masthead found.
|
||||
if( masthead && masthead.length ){
|
||||
if (scrollTop > masthead.offsetHeight + 100) {
|
||||
astScrollTop.style.display = "block";
|
||||
} else {
|
||||
astScrollTop.style.display = "none";
|
||||
}
|
||||
}
|
||||
else{
|
||||
// If there is no masthead set default start scroll
|
||||
if ( window.pageYOffset > 300 ) {
|
||||
astScrollTop.style.display = "block";
|
||||
} else {
|
||||
astScrollTop.style.display = "none";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
astScrollTop.style.display = "none";
|
||||
}
|
||||
};
|
||||
astScrollToTop();
|
||||
|
||||
window.addEventListener('scroll', function () {
|
||||
astScrollToTop();
|
||||
});
|
||||
|
||||
astScrollTop.onclick = function(e){
|
||||
e.preventDefault();
|
||||
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
left: 0,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Scroll To Top Addon
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @package Astra
|
||||
*/
|
||||
|
||||
define( 'ASTRA_SCROLL_TO_TOP_DIR', ASTRA_THEME_DIR . 'inc/addons/scroll-to-top/' );
|
||||
define( 'ASTRA_SCROLL_TO_TOP_URL', ASTRA_THEME_URI . 'inc/addons/scroll-to-top/' );
|
||||
|
||||
/**
|
||||
* Scroll To Top Initial Setup
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
class Astra_Scroll_To_Top {
|
||||
|
||||
/**
|
||||
* Member Variable
|
||||
*
|
||||
* @var null $instance
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
/** @psalm-suppress InvalidPropertyAssignmentValue */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
self::$instance = new self();
|
||||
/** @psalm-suppress InvalidPropertyAssignmentValue */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor function that initializes required actions and hooks
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
require_once ASTRA_SCROLL_TO_TOP_DIR . 'classes/class-astra-scroll-to-top-loader.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound -- Not a template file so loading in a normal way.
|
||||
|
||||
// Include front end files.
|
||||
if ( ! is_admin() ) {
|
||||
require_once ASTRA_SCROLL_TO_TOP_DIR . 'css/static-css.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound -- Not a template file so loading in a normal way.
|
||||
require_once ASTRA_SCROLL_TO_TOP_DIR . 'css/dynamic-css.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound -- Not a template file so loading in a normal way.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method.
|
||||
*/
|
||||
Astra_Scroll_To_Top::get_instance();
|
||||
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/**
|
||||
* Scroll to Top - Customizer.
|
||||
*
|
||||
* @package Astra
|
||||
* @since 4.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Customizer Initialization
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
class Astra_Scroll_To_Top_Loader {
|
||||
|
||||
/**
|
||||
* Member Variable
|
||||
*
|
||||
* @var null $instance
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
/** @psalm-suppress InvalidPropertyAssignmentValue */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
self::$instance = new self();
|
||||
/** @psalm-suppress InvalidPropertyAssignmentValue */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public function __construct() {
|
||||
add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
|
||||
add_action( 'customize_register', array( $this, 'new_customize_register' ), 2 );
|
||||
add_action( 'customize_preview_init', array( $this, 'preview_scripts' ) );
|
||||
add_action( 'wp_footer', array( $this, 'html_markup_loader' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Options Default Values
|
||||
*
|
||||
* @param array $defaults Astra options default value array.
|
||||
* @return array
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public function theme_defaults( $defaults ) {
|
||||
$astra_options = Astra_Theme_Options::get_astra_options();
|
||||
|
||||
$defaults['scroll-to-top-enable'] = true;
|
||||
$defaults['scroll-to-top-icon-size'] = 15;
|
||||
$defaults['scroll-to-top-icon-position'] = 'right';
|
||||
$defaults['scroll-to-top-on-devices'] = 'both';
|
||||
$defaults['scroll-to-top-icon-radius-fields'] = array(
|
||||
'desktop' => array(
|
||||
'top' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'],
|
||||
'right' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'],
|
||||
'bottom' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'],
|
||||
'left' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'],
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
);
|
||||
$defaults['scroll-to-top-icon-color'] = '';
|
||||
$defaults['scroll-to-top-icon-h-color'] = '';
|
||||
$defaults['scroll-to-top-icon-bg-color'] = '';
|
||||
$defaults['scroll-to-top-icon-h-bg-color'] = '';
|
||||
|
||||
return $defaults;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add customizer configs for scroll to top in the Theme Customizer.
|
||||
*
|
||||
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public function new_customize_register( $wp_customize ) {
|
||||
require_once ASTRA_SCROLL_TO_TOP_DIR . 'classes/customizer/class-astra-scroll-to-top-configs.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound -- Not a template file so loading in a normal way.
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Preview
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public function preview_scripts() {
|
||||
/** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( SCRIPT_DEBUG ) {
|
||||
/** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
wp_enqueue_script( 'astra-scroll-to-top-customize-preview-js', ASTRA_SCROLL_TO_TOP_URL . 'assets/js/unminified/customizer-preview.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
|
||||
} else {
|
||||
wp_enqueue_script( 'astra-scroll-to-top-customize-preview-js', ASTRA_SCROLL_TO_TOP_URL . 'assets/js/minified/customizer-preview.min.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scroll to Top addon markup loader
|
||||
*
|
||||
* Loads appropriate template file based on the style option selected in options panel.
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public function html_markup_loader() {
|
||||
if ( true === astra_get_option( 'scroll-to-top-enable', true ) ) {
|
||||
get_template_part( 'template-parts/scroll-to-top' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
Astra_Scroll_To_Top_Loader::get_instance();
|
||||
@@ -0,0 +1,310 @@
|
||||
<?php
|
||||
/**
|
||||
* Scroll To Top Options for our theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://www.brainstormforce.com
|
||||
* @since 4.0.0
|
||||
*/
|
||||
|
||||
// Block direct access to the file.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Bail if Customizer config base class does not exist.
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Scroll To Top Customizer Configurations.
|
||||
*/
|
||||
class Astra_Scroll_To_Top_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Scroll To Top Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 4.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Enable Scroll To Top
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
|
||||
'default' => astra_get_option( 'scroll-to-top-enable' ),
|
||||
'type' => 'control',
|
||||
'section' => 'section-scroll-to-top',
|
||||
'title' => __( 'Enable Scroll to Top', 'astra' ),
|
||||
'priority' => 1,
|
||||
'control' => 'ast-toggle-control',
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Scroll to Top Display On
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-on-devices]',
|
||||
'default' => astra_get_option( 'scroll-to-top-on-devices' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => 'section-scroll-to-top',
|
||||
'priority' => 10,
|
||||
'title' => __( 'Display On', 'astra' ),
|
||||
'choices' => array(
|
||||
'desktop' => __( 'Desktop', 'astra' ),
|
||||
'mobile' => __( 'Mobile', 'astra' ),
|
||||
'both' => __( 'Desktop + Mobile', 'astra' ),
|
||||
),
|
||||
'renderAs' => 'text',
|
||||
'responsive' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider ast-bottom-section-divider' ),
|
||||
'context' => array(
|
||||
'relation' => 'AND',
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Scroll to Top Position
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-icon-position]',
|
||||
'default' => astra_get_option( 'scroll-to-top-icon-position' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'transport' => 'postMessage',
|
||||
'section' => 'section-scroll-to-top',
|
||||
'title' => __( 'Position', 'astra' ),
|
||||
'choices' => array(
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
),
|
||||
'priority' => 11,
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
'context' => array(
|
||||
'relation' => 'AND',
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Scroll To Top Icon Size
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-icon-size]',
|
||||
'default' => astra_get_option( 'scroll-to-top-icon-size' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'transport' => 'postMessage',
|
||||
'section' => 'section-scroll-to-top',
|
||||
'title' => __( 'Icon Size', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'priority' => 12,
|
||||
'context' => array(
|
||||
'relation' => 'AND',
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[scroll-on-top-color-group]',
|
||||
'default' => astra_get_option( 'scroll-on-top-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Icon Color', 'astra' ),
|
||||
'section' => 'section-scroll-to-top',
|
||||
'context' => array(
|
||||
'relation' => 'AND',
|
||||
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'priority' => 1,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[scroll-on-top-bg-color-group]',
|
||||
'default' => astra_get_option( 'scroll-on-top-bg-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Background Color', 'astra' ),
|
||||
'section' => 'section-scroll-to-top',
|
||||
'transport' => 'postMessage',
|
||||
'context' => array(
|
||||
'relation' => 'AND',
|
||||
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'priority' => 1,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Scroll To Top Radius
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-icon-radius-fields]',
|
||||
'default' => astra_get_option( 'scroll-to-top-icon-radius-fields' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'transport' => 'postMessage',
|
||||
'section' => 'section-scroll-to-top',
|
||||
'title' => __( 'Border Radius', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'priority' => 1,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
'context' => array(
|
||||
'relation' => 'AND',
|
||||
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'connected' => false,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Icon Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'scroll-to-top-icon-color',
|
||||
'default' => astra_get_option( 'scroll-to-top-icon-color' ),
|
||||
'type' => 'sub-control',
|
||||
'priority' => 1,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[scroll-on-top-color-group]',
|
||||
'section' => 'section-scroll-to-top',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Icon Background Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'scroll-to-top-icon-bg-color',
|
||||
'default' => astra_get_option( 'scroll-to-top-icon-bg-color' ),
|
||||
'type' => 'sub-control',
|
||||
'priority' => 1,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[scroll-on-top-bg-color-group]',
|
||||
'section' => 'section-scroll-to-top',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'title' => __( 'Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Icon Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'scroll-to-top-icon-h-color',
|
||||
'default' => astra_get_option( 'scroll-to-top-icon-h-color' ),
|
||||
'type' => 'sub-control',
|
||||
'priority' => 1,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[scroll-on-top-color-group]',
|
||||
'section' => 'section-scroll-to-top',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Hover Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Link Hover Background Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'scroll-to-top-icon-h-bg-color',
|
||||
'default' => astra_get_option( 'scroll-to-top-icon-h-bg-color' ),
|
||||
'type' => 'sub-control',
|
||||
'priority' => 1,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[scroll-on-top-bg-color-group]',
|
||||
'section' => 'section-scroll-to-top',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Hover Color', 'astra' ),
|
||||
),
|
||||
);
|
||||
|
||||
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
|
||||
$_configs[] = array(
|
||||
'name' => 'section-scroll-to-top-ast-context-tabs',
|
||||
'section' => 'section-scroll-to-top',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
);
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[enable-scroll-to-top-notice]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-description',
|
||||
'section' => 'section-scroll-to-top',
|
||||
'priority' => 1,
|
||||
'label' => '',
|
||||
'help' => __( 'Note: To get design settings in action make sure to enable Scroll to Top.', 'astra' ),
|
||||
'context' => array(
|
||||
'relation' => 'AND',
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
|
||||
'operator' => '!=',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$configurations = array_merge( $configurations, $_configs );
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/** Creating instance for getting customizer configs. */
|
||||
new Astra_Scroll_To_Top_Configs();
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
/**
|
||||
* Scroll To Top - Dynamic CSS
|
||||
*
|
||||
* @package Astra
|
||||
*/
|
||||
|
||||
add_filter( 'astra_dynamic_theme_css', 'astra_scroll_to_top_dynamic_css', 11 );
|
||||
|
||||
/**
|
||||
* Dynamic CSS
|
||||
*
|
||||
* @param string $dynamic_css Astra Dynamic CSS.
|
||||
* @param string $dynamic_css_filtered Astra Dynamic CSS Filters.
|
||||
* @return string
|
||||
*/
|
||||
function astra_scroll_to_top_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
|
||||
|
||||
if ( true !== astra_get_option( 'scroll-to-top-enable', true ) ) {
|
||||
return $dynamic_css;
|
||||
}
|
||||
|
||||
$link_color = astra_get_option( 'link-color' );
|
||||
$scroll_to_top_icon_size = astra_get_option( 'scroll-to-top-icon-size', 15 );
|
||||
$scroll_to_top_icon_radius_fields = astra_get_option( 'scroll-to-top-icon-radius-fields' );
|
||||
$scroll_to_top_icon_color = astra_get_option( 'scroll-to-top-icon-color' );
|
||||
$scroll_to_top_icon_h_color = astra_get_option( 'scroll-to-top-icon-h-color' );
|
||||
$scroll_to_top_icon_bg_color = astra_get_option( 'scroll-to-top-icon-bg-color', $link_color );
|
||||
$scroll_to_top_icon_h_bg_color = astra_get_option( 'scroll-to-top-icon-h-bg-color' );
|
||||
|
||||
$scroll_to_top = array(
|
||||
'#ast-scroll-top' => array(
|
||||
'color' => $scroll_to_top_icon_color,
|
||||
'background-color' => $scroll_to_top_icon_bg_color,
|
||||
'font-size' => astra_get_css_value( $scroll_to_top_icon_size, 'px' ),
|
||||
'border-top-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'top', 'desktop' ),
|
||||
'border-top-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'right', 'desktop' ),
|
||||
'border-bottom-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'bottom', 'desktop' ),
|
||||
'border-bottom-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'left', 'desktop' ),
|
||||
),
|
||||
'#ast-scroll-top:hover' => array(
|
||||
'color' => $scroll_to_top_icon_h_color,
|
||||
'background-color' => $scroll_to_top_icon_h_bg_color,
|
||||
),
|
||||
);
|
||||
|
||||
$scroll_css = astra_parse_css( $scroll_to_top );
|
||||
|
||||
$scroll_to_top_tablet = array(
|
||||
'#ast-scroll-top' => array(
|
||||
'border-top-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'top', 'tablet' ),
|
||||
'border-top-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'right', 'tablet' ),
|
||||
'border-bottom-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'bottom', 'tablet' ),
|
||||
'border-bottom-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'left', 'tablet' ),
|
||||
),
|
||||
);
|
||||
/* Parse CSS from array() -> max-width: (tablet-breakpoint) px CSS */
|
||||
$scroll_css .= astra_parse_css( $scroll_to_top_tablet, '', astra_get_tablet_breakpoint() );
|
||||
|
||||
$scroll_to_top_mobile = array(
|
||||
'#ast-scroll-top' => array(
|
||||
'border-top-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'top', 'mobile' ),
|
||||
'border-top-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'right', 'mobile' ),
|
||||
'border-bottom-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'bottom', 'mobile' ),
|
||||
'border-bottom-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'left', 'mobile' ),
|
||||
),
|
||||
);
|
||||
/* Parse CSS from array() -> max-width: (mobile-breakpoint) px CSS */
|
||||
$scroll_css .= astra_parse_css( $scroll_to_top_mobile, '', astra_get_mobile_breakpoint() );
|
||||
|
||||
if ( is_rtl() ) {
|
||||
$scroll_to_top_rtl = array(
|
||||
'#ast-scroll-top .ast-icon.icon-arrow svg' => array(
|
||||
'margin-right' => '0px',
|
||||
),
|
||||
);
|
||||
|
||||
$scroll_css .= astra_parse_css( $scroll_to_top_rtl );
|
||||
}
|
||||
|
||||
if ( false === Astra_Icons::is_svg_icons() ) {
|
||||
$scroll_to_top_icon = array(
|
||||
'.ast-scroll-top-icon::before' => array(
|
||||
'content' => '"\e900"',
|
||||
'font-family' => 'Astra',
|
||||
'text-decoration' => 'inherit',
|
||||
),
|
||||
'.ast-scroll-top-icon' => array(
|
||||
'transform' => 'rotate(180deg)',
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
$scroll_css .= astra_parse_css( $scroll_to_top_icon );
|
||||
}
|
||||
|
||||
// Only if responsive devices is selected.
|
||||
$svg_width = array(
|
||||
/**
|
||||
* Add spacing based on padded layout spacing
|
||||
*/
|
||||
'#ast-scroll-top .ast-icon.icon-arrow svg' => array(
|
||||
'width' => '1em',
|
||||
),
|
||||
);
|
||||
|
||||
$scroll_css .= astra_parse_css( $svg_width, '', astra_get_tablet_breakpoint() );
|
||||
|
||||
return $dynamic_css . $scroll_css;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* Scroll to Top - Static CSS
|
||||
*
|
||||
* @package Astra
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
add_filter( 'astra_dynamic_theme_css', 'astra_scroll_to_top_static_css', 11 );
|
||||
|
||||
/**
|
||||
* Scroll to Top - Static CSS
|
||||
*
|
||||
* @param string $dynamic_css Astra Dynamic CSS.
|
||||
* @return String Generated dynamic CSS for Scroll to Top.
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
function astra_scroll_to_top_static_css( $dynamic_css ) {
|
||||
|
||||
if ( true !== astra_get_option( 'scroll-to-top-enable', true ) ) {
|
||||
return $dynamic_css;
|
||||
}
|
||||
|
||||
$is_site_rtl = is_rtl() ? true : false;
|
||||
$ltr_left = $is_site_rtl ? 'right' : 'left';
|
||||
$ltr_right = $is_site_rtl ? 'left' : 'right';
|
||||
|
||||
$dynamic_css .= '
|
||||
#ast-scroll-top {
|
||||
display: none;
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
z-index: 99;
|
||||
width: 2.1em;
|
||||
height: 2.1em;
|
||||
line-height: 2.1;
|
||||
color: #ffffff;
|
||||
border-radius: 2px;
|
||||
content: "";
|
||||
outline: inherit;
|
||||
}
|
||||
@media (min-width: 769px) {
|
||||
#ast-scroll-top {
|
||||
content: "769";
|
||||
}
|
||||
}
|
||||
#ast-scroll-top .ast-icon.icon-arrow svg {
|
||||
margin-' . esc_attr( $ltr_left ) . ': 0px;
|
||||
vertical-align: middle;
|
||||
transform: translate(0, -20%) rotate(180deg);
|
||||
width: 1.6em;
|
||||
}
|
||||
.ast-scroll-to-top-right {
|
||||
' . esc_attr( $ltr_right ) . ': 30px;
|
||||
bottom: 30px;
|
||||
}
|
||||
.ast-scroll-to-top-left {
|
||||
' . esc_attr( $ltr_left ) . ': 30px;
|
||||
bottom: 30px;
|
||||
}
|
||||
';
|
||||
|
||||
return $dynamic_css;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,286 @@
|
||||
/**
|
||||
* This file adds some LIVE to the Customizer live preview. To leverage
|
||||
* this, set your custom settings to 'postMessage' and then add your handling
|
||||
* here. Your javascript should grab settings from customizer controls, and
|
||||
* then make any necessary changes to the page using jQuery.
|
||||
*
|
||||
* @package Astra
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
( function( $ ) {
|
||||
|
||||
var isAstraHFBuilderActive = AstraBuilderTransparentData.is_astra_hf_builder_active || false;
|
||||
|
||||
/**
|
||||
* Transparent Logo Width
|
||||
*/
|
||||
wp.customize( 'astra-settings[transparent-header-logo-width]', function( setting ) {
|
||||
setting.bind( function( logo_width ) {
|
||||
if ( logo_width['desktop'] != '' || logo_width['tablet'] != '' || logo_width['mobile'] != '' ) {
|
||||
var dynamicStyle = '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img {max-width: ' + logo_width['desktop'] + 'px;} .ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg { width: ' + logo_width['desktop'] + 'px;} @media( max-width: 768px ) { .ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img {max-width: ' + logo_width['tablet'] + 'px;} .ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg { width: ' + logo_width['tablet'] + 'px;} } @media( max-width: 544px ) { .ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img {max-width: ' + logo_width['mobile'] + 'px;} .ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg { width: ' + logo_width['mobile'] + 'px;} }';
|
||||
astra_add_dynamic_css( 'transparent-header-logo-width', dynamicStyle );
|
||||
}
|
||||
else{
|
||||
wp.customize.preview.send( 'refresh' );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
// Transparent header for device.
|
||||
const device = AstraBuilderTransparentData.transparent_header_devices;
|
||||
let deviceSelector = '';
|
||||
switch( device ) {
|
||||
case 'mobile' :
|
||||
deviceSelector = '.ast-header-break-point';
|
||||
break;
|
||||
case 'desktop' :
|
||||
deviceSelector = ':not(.ast-header-break-point)';
|
||||
break;
|
||||
}
|
||||
|
||||
/* Transparent Header Colors */
|
||||
astra_color_responsive_css( 'colors-background', 'astra-settings[primary-menu-a-bg-color-responsive]', 'background-color', '.main-header-menu .current-menu-item > .menu-link, .main-header-menu .current-menu-ancestor > .menu-link,.ast-header-sections-navigation .menu-item.current-menu-item > .menu-link,.ast-header-sections-navigation .menu-item.current-menu-ancestor > .menu-link' );
|
||||
|
||||
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-header-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header' + deviceSelector + ' .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header' + deviceSelector + ' .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header' + ( device === 'both' ? '.ast-header-break-point' : deviceSelector ) + ' .ast-mobile-header-wrap .main-header-bar' );
|
||||
|
||||
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-header-color-site-title-responsive]', 'color', '.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited, .ast-theme-transparent-header .site-header .site-description' );
|
||||
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-header-color-h-site-title-responsive]', 'color', '.ast-theme-transparent-header .site-header .site-title a:hover' );
|
||||
|
||||
// Primary Menu
|
||||
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-menu-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' );
|
||||
|
||||
astra_color_responsive_css( 'transparent-primary-header-menu-colors', 'astra-settings[transparent-menu-color-responsive]', 'color', '.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-link' );
|
||||
|
||||
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-menu-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' );
|
||||
|
||||
// Primary SubMenu
|
||||
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-submenu-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .sub-menu, .ast-header-break-point.ast-theme-transparent-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .sub-menu .menu-link, .ast-header-break-point.ast-theme-transparent-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-theme-transparent-header .main-header-menu .menu-item .sub-menu' );
|
||||
|
||||
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-submenu-color-responsive]', 'color', '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .astra-hfb-header.ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .sub-menu .menu-item .menu-link, .astra-hfb-header.ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link' );
|
||||
|
||||
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-submenu-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu a:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover .menu-link' );
|
||||
|
||||
// Style guide main header logo preview.
|
||||
var primaryHeaderWrap = document.querySelector( ".ast-main-header-wrap.main-header-bar-wrap ");
|
||||
|
||||
if ( primaryHeaderWrap && primaryHeaderWrap.querySelector(".site-logo-img") ) {
|
||||
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-header-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header' + deviceSelector + ' .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header' + deviceSelector + ' .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header' + ( device === 'both' ? '.ast-header-break-point' : deviceSelector ) + ' .ast-mobile-header-wrap .main-header-bar, .ast-theme-transparent-header .ast-sg-element-wrap.ast-sg-logo-section' );
|
||||
}
|
||||
|
||||
// Primary Content Section text color
|
||||
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-content-section-text-color-responsive]', 'color', '.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' );
|
||||
// Primary Content Section link color
|
||||
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-content-section-link-color-responsive]', 'color', '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element a' );
|
||||
// Primary Content Section link hover color
|
||||
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-content-section-link-h-color-responsive]', 'color', '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element a:hover' );
|
||||
|
||||
// Above Header Menu
|
||||
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[hba-transparent-header-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header' + deviceSelector + ' .ast-above-header-wrap .ast-above-header, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-wrap .main-header-menu' );
|
||||
|
||||
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-menu-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header .ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-section-separated .ast-above-header-navigation ul, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-section-separated .ast-above-header-navigation-wrap' );
|
||||
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-menu-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' );
|
||||
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-menu-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' )
|
||||
// Above Header SubMenu
|
||||
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-submenu-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header .ast-above-header-menu .sub-menu' );
|
||||
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-submenu-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' );
|
||||
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-submenu-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' );
|
||||
|
||||
// Above Header Content Section text color
|
||||
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-content-section-text-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' );
|
||||
// Above Header Content Section link color
|
||||
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-content-section-link-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' );
|
||||
// Above Header Content Section link hover color
|
||||
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-content-section-link-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' );
|
||||
|
||||
|
||||
// Style guide above header logo preview.
|
||||
var aboveHeaderWrap = document.querySelector( ".ast-above-header-wrap");
|
||||
|
||||
if ( aboveHeaderWrap && aboveHeaderWrap.querySelector(".site-logo-img") ) {
|
||||
astra_color_responsive_css( "transparent-above-header", "astra-settings[hba-transparent-header-bg-color-responsive]", "background-color", " .ast-theme-transparent-header" + deviceSelector + " .ast-above-header-wrap .ast-above-header, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-wrap .main-header-menu, .ast-theme-transparent-header .ast-sg-element-wrap.ast-sg-logo-section" );
|
||||
}
|
||||
|
||||
// below Header Menu
|
||||
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[hbb-transparent-header-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header' + deviceSelector + ' .ast-below-header-wrap .ast-below-header, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-wrap .main-header-menu' );
|
||||
|
||||
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-menu-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-section-separated .ast-below-header-navigation-wrap' );
|
||||
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-menu-color-responsive]', 'color', '.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' );
|
||||
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-menu-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link,.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' );
|
||||
// below Header SubMenu
|
||||
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-submenu-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header .ast-below-header-menu .sub-menu' );
|
||||
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-submenu-color-responsive]', 'color', '.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' );
|
||||
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-submenu-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' );
|
||||
|
||||
// below Header Content Section text color
|
||||
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-content-section-text-color-responsive]', 'color', '', '.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' );
|
||||
// below Header Content Section link color
|
||||
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-content-section-link-color-responsive]', 'color', '', '.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' );
|
||||
// below Header Content Section link hover color
|
||||
astra_color_responsive_css( 'below-transparent-header', 'astra-settings[transparent-content-section-link-h-color-responsive]', 'color', '.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' );
|
||||
|
||||
// Style guide below header logo preview.
|
||||
var belowHeaderWrap = document.querySelector( ".ast-below-header-wrap ");
|
||||
|
||||
if ( belowHeaderWrap && belowHeaderWrap.querySelector(".site-logo-img") ) {
|
||||
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[hbb-transparent-header-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header' + deviceSelector + ' .ast-below-header-wrap .ast-below-header, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-wrap .main-header-menu, .ast-theme-transparent-header .ast-sg-element-wrap.ast-sg-logo-section' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Button border
|
||||
*/
|
||||
wp.customize( 'astra-settings[primary-header-button-border-group]', function( value ) {
|
||||
value.bind( function( value ) {
|
||||
|
||||
var optionValue = JSON.parse(value);
|
||||
var border = optionValue['header-main-rt-section-button-border-size'];
|
||||
|
||||
if( '' != border.top || '' != border.right || '' != border.bottom || '' != border.left ) {
|
||||
var dynamicStyle = '.main-header-bar .ast-container .button-custom-menu-item .ast-custom-button-link .ast-custom-button';
|
||||
dynamicStyle += '{';
|
||||
dynamicStyle += 'border-top-width:' + border.top + 'px;';
|
||||
dynamicStyle += 'border-right-width:' + border.right + 'px;';
|
||||
dynamicStyle += 'border-left-width:' + border.left + 'px;';
|
||||
dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;';
|
||||
dynamicStyle += 'border-style: solid;';
|
||||
dynamicStyle += '}';
|
||||
|
||||
astra_add_dynamic_css( 'header-main-rt-section-button-border-size', dynamicStyle );
|
||||
}
|
||||
|
||||
} );
|
||||
} );
|
||||
|
||||
astra_css( 'astra-settings[header-main-rt-trans-section-button-text-color]', 'color', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
|
||||
astra_css( 'astra-settings[header-main-rt-trans-section-button-back-color]', 'background-color', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
|
||||
astra_css( 'astra-settings[header-main-rt-trans-section-button-text-h-color]', 'color', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' );
|
||||
astra_css( 'astra-settings[header-main-rt-trans-section-button-back-h-color]', 'background-color', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' );
|
||||
astra_css( 'astra-settings[header-main-rt-trans-section-button-border-radius]', 'border-radius', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button', 'px' );
|
||||
astra_css( 'astra-settings[header-main-rt-trans-section-button-border-color]', 'border-color', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
|
||||
astra_css( 'astra-settings[header-main-rt-trans-section-button-border-h-color]', 'border-color', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' );
|
||||
astra_responsive_spacing( 'astra-settings[header-main-rt-trans-section-button-padding]','.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button', 'padding', ['top', 'right', 'bottom', 'left' ] );
|
||||
|
||||
/**
|
||||
* Transparent Header > Elements preview styles.
|
||||
*/
|
||||
astra_css( 'astra-settings[transparent-header-divider-color]', 'border-color', '.ast-theme-transparent-header .ast-header-divider-element .ast-divider-wrapper' );
|
||||
astra_css( 'astra-settings[transparent-header-html-text-color]', 'color', '.ast-theme-transparent-header [CLASS*="ast-header-html-"] .ast-builder-html-element' );
|
||||
astra_css( 'astra-settings[transparent-header-html-link-color]', 'color', '.ast-theme-transparent-header [CLASS*="ast-header-html-"] .ast-builder-html-element a' );
|
||||
astra_css( 'astra-settings[transparent-header-html-link-h-color]', 'color', '.ast-theme-transparent-header [CLASS*="ast-header-html-"] .ast-builder-html-element a:hover' );
|
||||
astra_css( 'astra-settings[transparent-header-search-icon-color]', 'color', '.ast-theme-transparent-header .ast-header-search .astra-search-icon, .ast-theme-transparent-header .ast-header-search .ast-icon' );
|
||||
astra_css( 'astra-settings[transparent-header-search-box-placeholder-color]', 'color', '.ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-field, .ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-field::placeholder' );
|
||||
astra_css( 'astra-settings[transparent-header-search-box-background-color]', 'background-color', '.ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-field, .ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-form, .ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-submit' );
|
||||
astra_color_responsive_css( 'transparent-header-social-color', 'astra-settings[transparent-header-social-icons-bg-color]', 'background', '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element' );
|
||||
astra_color_responsive_css( 'transparent-header-social-color', 'astra-settings[transparent-header-social-icons-color]', 'fill', '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element svg' );
|
||||
astra_color_responsive_css( 'transparent-header-social-color-label', 'astra-settings[transparent-header-social-icons-color]', 'color', '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element .social-item-label' );
|
||||
astra_color_responsive_css( 'transparent-header-social-color', 'astra-settings[transparent-header-social-icons-bg-h-color]', 'background', '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover' );
|
||||
astra_color_responsive_css( 'transparent-header-social-color', 'astra-settings[transparent-header-social-icons-h-color]', 'fill', '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover svg' );
|
||||
astra_color_responsive_css( 'transparent-header-social-color-label-h', 'astra-settings[transparent-header-social-icons-h-color]', 'color', '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover .social-item-label' );
|
||||
astra_css( 'astra-settings[transparent-header-widget-title-color]', 'color', '.ast-theme-transparent-header .widget-area.header-widget-area .widget-title' );
|
||||
|
||||
if( AstraBuilderTransparentData.is_flex_based_css ) {
|
||||
var transparent_header_widget = '.ast-theme-transparent-header .widget-area.header-widget-area.header-widget-area-inner';
|
||||
}else{
|
||||
var transparent_header_widget = '.ast-theme-transparent-header .widget-area.header-widget-area. header-widget-area-inner';
|
||||
}
|
||||
astra_css( 'astra-settings[transparent-header-widget-content-color]', 'color', transparent_header_widget );
|
||||
astra_css( 'astra-settings[transparent-header-widget-link-color]', 'color', transparent_header_widget + ' a' );
|
||||
astra_css( 'astra-settings[transparent-header-widget-link-h-color]', 'color', transparent_header_widget + ' a:hover' );
|
||||
|
||||
astra_css( 'astra-settings[transparent-header-button-text-color]', 'color', '.ast-theme-transparent-header [CLASS*="ast-header-button-"] .ast-custom-button' );
|
||||
astra_css( 'astra-settings[transparent-header-button-bg-color]', 'background', '.ast-theme-transparent-header [CLASS*="ast-header-button-"] .ast-custom-button' );
|
||||
astra_css( 'astra-settings[transparent-header-button-text-h-color]', 'color', '.ast-theme-transparent-header [CLASS*="ast-header-button-"] ..ast-custom-button:hover' );
|
||||
astra_css( 'astra-settings[transparent-header-button-bg-h-color]', 'background', '.ast-theme-transparent-header [CLASS*="ast-header-button-"] .ast-custom-button:hover' );
|
||||
astra_css( 'astra-settings[transparent-header-button-border-color]', 'border-color', '.ast-theme-transparent-header [CLASS*="ast-header-button-"] .ast-custom-button' );
|
||||
astra_css( 'astra-settings[transparent-header-button-border-h-color]', 'border-color', '.ast-theme-transparent-header [CLASS*="ast-header-button-"] ..ast-custom-button:hover' );
|
||||
|
||||
/**
|
||||
* Transparent Header menu-toggle Dynamic CSS.
|
||||
*/
|
||||
var toggle_selector = '.ast-theme-transparent-header [data-section="section-header-mobile-trigger"]';
|
||||
|
||||
// Trigger Icon Color.
|
||||
astra_css(
|
||||
'astra-settings[transparent-header-toggle-btn-color]',
|
||||
'fill',
|
||||
toggle_selector + ' .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg'
|
||||
);
|
||||
|
||||
// Trigger Label Color.
|
||||
astra_css(
|
||||
'astra-settings[transparent-header-toggle-btn-color]',
|
||||
'color',
|
||||
toggle_selector + ' .ast-button-wrap .mobile-menu-wrap .mobile-menu'
|
||||
);
|
||||
|
||||
// Trigger Button Background Color.
|
||||
astra_css(
|
||||
'astra-settings[transparent-header-toggle-btn-bg-color]',
|
||||
'background',
|
||||
toggle_selector + ' .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-fill'
|
||||
);
|
||||
|
||||
// Border Color.
|
||||
astra_css(
|
||||
'astra-settings[transparent-header-toggle-border-color]',
|
||||
'border-color',
|
||||
toggle_selector + ' .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-outline'
|
||||
);
|
||||
|
||||
// Icon Color.
|
||||
astra_css(
|
||||
'astra-settings[transparent-account-icon-color]',
|
||||
'fill',
|
||||
'.ast-theme-transparent-header .ast-header-account-wrap .ast-header-account-type-icon .ahfb-svg-iconset svg path:not(.ast-hf-account-unfill), .ast-theme-transparent-header .ast-header-account-wrap .ast-header-account-type-icon .ahfb-svg-iconset svg circle'
|
||||
);
|
||||
|
||||
// logged out text Color.
|
||||
astra_css(
|
||||
'astra-settings[transparent-account-type-text-color]',
|
||||
'color',
|
||||
'.ast-theme-transparent-header .ast-header-account-wrap .ast-header-account-text'
|
||||
);
|
||||
|
||||
// Menu - Normal Color
|
||||
astra_css(
|
||||
'astra-settings[transparent-account-menu-color]',
|
||||
'color',
|
||||
'.ast-theme-transparent-header .ast-header-account-wrap .main-header-menu .menu-item > .menu-link'
|
||||
);
|
||||
|
||||
// Menu - Hover Color
|
||||
astra_css(
|
||||
'astra-settings[transparent-account-menu-h-color]',
|
||||
'color',
|
||||
'.ast-theme-transparent-header .ast-header-account-wrap .main-header-menu .menu-item:hover > .menu-link'
|
||||
);
|
||||
|
||||
// Menu - Active Color
|
||||
astra_css(
|
||||
'astra-settings[transparent-account-menu-a-color]',
|
||||
'color',
|
||||
'.ast-theme-transparent-header .ast-header-account-wrap .main-header-menu .menu-item.current-menu-item > .menu-link'
|
||||
);
|
||||
|
||||
// Menu - Hover Background
|
||||
astra_css(
|
||||
'astra-settings[transparent-account-menu-bg-obj]',
|
||||
'background',
|
||||
'.ast-theme-transparent-header .ast-header-account-wrap .account-main-navigation ul'
|
||||
);
|
||||
|
||||
// Menu - Hover Background
|
||||
astra_css(
|
||||
'astra-settings[transparent-account-menu-h-bg-color]',
|
||||
'background',
|
||||
'.ast-theme-transparent-header .ast-header-account-wrap .account-main-navigation .menu-item:hover > .menu-link'
|
||||
);
|
||||
|
||||
// Menu - Active Background
|
||||
astra_css(
|
||||
'astra-settings[transparent-account-menu-a-bg-color]',
|
||||
'background',
|
||||
'.ast-theme-transparent-header .ast-header-account-wrap .account-main-navigation .menu-item.current-menu-item > .menu-link'
|
||||
);
|
||||
|
||||
} )( jQuery );
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* Sticky Header Extension
|
||||
*
|
||||
* @package Astra
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
define( 'ASTRA_THEME_TRANSPARENT_HEADER_DIR', ASTRA_THEME_DIR . 'inc/addons/transparent-header/' );
|
||||
define( 'ASTRA_THEME_TRANSPARENT_HEADER_URI', ASTRA_THEME_URI . 'inc/addons/transparent-header/' );
|
||||
|
||||
if ( ! class_exists( 'Astra_Ext_Transparent_Header' ) ) {
|
||||
|
||||
/**
|
||||
* Sticky Header Initial Setup
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Astra_Ext_Transparent_Header {
|
||||
|
||||
/**
|
||||
* Member Variable
|
||||
*
|
||||
* @var object instance
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor function that initializes required actions and hooks
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
||||
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/class-astra-ext-transparent-header-loader.php';
|
||||
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/class-astra-ext-transparent-header-markup.php';
|
||||
|
||||
// Include front end files.
|
||||
if ( ! is_admin() ) {
|
||||
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/dynamic-css/dynamic.css.php';
|
||||
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/dynamic-css/header-sections-dynamic.css.php';
|
||||
}
|
||||
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
Astra_Ext_Transparent_Header::get_instance();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
<?php
|
||||
/**
|
||||
* Transparent Header - Customizer.
|
||||
*
|
||||
* @package Astra
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Ext_Transparent_Header_Loader' ) ) {
|
||||
|
||||
/**
|
||||
* Customizer Initialization
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Astra_Ext_Transparent_Header_Loader {
|
||||
|
||||
/**
|
||||
* Member Variable
|
||||
*
|
||||
* @var object instance
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
|
||||
add_action( 'customize_preview_init', array( $this, 'preview_scripts' ) );
|
||||
add_action( 'customize_register', array( $this, 'customize_register' ), 2 );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Options Default Values
|
||||
*
|
||||
* @param array $defaults Astra options default value array.
|
||||
* @return array
|
||||
*/
|
||||
public function theme_defaults( $defaults ) {
|
||||
|
||||
// Header - Transparent.
|
||||
$defaults['transparent-header-logo'] = '';
|
||||
$defaults['transparent-header-retina-logo'] = '';
|
||||
$defaults['different-transparent-logo'] = 0;
|
||||
$defaults['different-transparent-retina-logo'] = 0;
|
||||
$defaults['transparent-header-logo-width'] = array(
|
||||
'desktop' => 150,
|
||||
'tablet' => 120,
|
||||
'mobile' => 100,
|
||||
);
|
||||
$defaults['transparent-header-enable'] = 0;
|
||||
/**
|
||||
* Old option for 404, search and archive pages.
|
||||
*
|
||||
* For default value on separate option this setting is in use.
|
||||
*/
|
||||
$defaults['transparent-header-disable-archive'] = 1;
|
||||
$defaults['transparent-header-disable-latest-posts-index'] = 1;
|
||||
$defaults['transparent-header-on-devices'] = 'both';
|
||||
$defaults['transparent-header-main-sep'] = '';
|
||||
$defaults['transparent-header-main-sep-color'] = '';
|
||||
|
||||
/**
|
||||
* Transparent Header
|
||||
*/
|
||||
$defaults['transparent-header-bg-color'] = '';
|
||||
$defaults['transparent-header-color-site-title'] = '';
|
||||
$defaults['transparent-header-color-h-site-title'] = '';
|
||||
$defaults['transparent-menu-bg-color'] = '';
|
||||
$defaults['transparent-menu-color'] = '';
|
||||
$defaults['transparent-menu-h-color'] = '';
|
||||
$defaults['transparent-submenu-bg-color'] = '';
|
||||
$defaults['transparent-submenu-color'] = '';
|
||||
$defaults['transparent-submenu-h-color'] = '';
|
||||
$defaults['transparent-header-logo-color'] = '';
|
||||
|
||||
/**
|
||||
* Transparent Header Responsive Colors
|
||||
*/
|
||||
$defaults['transparent-header-bg-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['hba-transparent-header-bg-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['hbb-transparent-header-bg-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['transparent-header-color-site-title-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['transparent-header-color-h-site-title-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['transparent-menu-bg-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['transparent-menu-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['transparent-menu-h-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['transparent-submenu-bg-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['transparent-submenu-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['transparent-submenu-h-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
$defaults['transparent-content-section-text-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
$defaults['transparent-content-section-link-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
$defaults['transparent-content-section-link-h-color-responsive'] = array(
|
||||
'desktop' => '',
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
);
|
||||
|
||||
return $defaults;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add postMessage support for site title and description for the Theme Customizer.
|
||||
*
|
||||
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
|
||||
*/
|
||||
public function customize_register( $wp_customize ) {
|
||||
|
||||
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
||||
/**
|
||||
* Register Panel & Sections
|
||||
*/
|
||||
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/class-astra-transparent-header-panels-and-sections.php';
|
||||
|
||||
/**
|
||||
* Sections
|
||||
*/
|
||||
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/sections/class-astra-customizer-colors-transparent-header-configs.php';
|
||||
// Check Transparent Header is activated.
|
||||
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/sections/class-astra-customizer-transparent-header-configs.php';
|
||||
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Preview
|
||||
*/
|
||||
public function preview_scripts() {
|
||||
/**
|
||||
* Load unminified if SCRIPT_DEBUG is true.
|
||||
*/
|
||||
/* Directory and Extension */
|
||||
$dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
|
||||
$file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
|
||||
wp_enqueue_script( 'astra-transparent-header-customizer-preview-js', ASTRA_THEME_TRANSPARENT_HEADER_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
|
||||
|
||||
// Localize variables for further JS.
|
||||
wp_localize_script(
|
||||
'astra-transparent-header-customizer-preview-js',
|
||||
'AstraBuilderTransparentData',
|
||||
array(
|
||||
'is_astra_hf_builder_active' => Astra_Builder_Helper::$is_header_footer_builder_active,
|
||||
'is_flex_based_css' => Astra_Builder_Helper::apply_flex_based_css(),
|
||||
'transparent_header_devices' => astra_get_option( 'transparent-header-on-devices' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
Astra_Ext_Transparent_Header_Loader::get_instance();
|
||||
@@ -0,0 +1,398 @@
|
||||
<?php
|
||||
/**
|
||||
* Transparent Header Markup
|
||||
*
|
||||
* @package Astra
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_ExtTransparenty_Header_Markup' ) ) {
|
||||
|
||||
/**
|
||||
* Transparent Header Markup Initial Setup
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Astra_Ext_Transparent_Header_Markup {
|
||||
|
||||
/**
|
||||
* Member Variable
|
||||
*
|
||||
* @var object instance
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
add_action( 'body_class', array( $this, 'add_body_class' ) );
|
||||
|
||||
/* Fixed header markup */
|
||||
add_action( 'astra_header', array( $this, 'transparent_header_logo' ), 1 );
|
||||
|
||||
/**
|
||||
* Metabox setup
|
||||
*/
|
||||
add_filter( 'astra_meta_box_options', array( $this, 'add_options' ) );
|
||||
add_action( 'astra_meta_box_markup_after', array( $this, 'add_options_markup' ) );
|
||||
|
||||
add_action( 'astra_customizer_save', array( $this, 'customizer_save' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Body Classes
|
||||
*
|
||||
* @param array $classes Body Class Array.
|
||||
* @return array
|
||||
*/
|
||||
public function add_body_class( $classes ) {
|
||||
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
$inherit_desk_logo = astra_get_option( 'different-transparent-logo', false );
|
||||
$transparent_header_logo = astra_get_option( 'transparent-header-logo', true );
|
||||
$transparent_header_logo_retina = astra_get_option( 'transparent-header-retina-logo', true );
|
||||
|
||||
if ( '1' == $inherit_desk_logo && ( '' !== $transparent_header_logo || '' !== $transparent_header_logo_retina ) ) {
|
||||
$classes[] = 'ast-replace-site-logo-transparent';
|
||||
}
|
||||
|
||||
if ( '1' !== $inherit_desk_logo ) {
|
||||
$classes[] = 'ast-inherit-site-logo-transparent';
|
||||
}
|
||||
|
||||
/**
|
||||
* Add class 'ast-theme-transparent-header'
|
||||
*/
|
||||
|
||||
if ( self::is_transparent_header() ) {
|
||||
$classes[] = 'ast-theme-transparent-header';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Astra check if transparent header is enabled.
|
||||
*
|
||||
* @return boolean true/false.
|
||||
*/
|
||||
public static function is_transparent_header() {
|
||||
|
||||
// Transparent Header.
|
||||
$enable_trans_header = astra_get_option( 'transparent-header-enable' );
|
||||
$trans_meta_option = astra_get_option_meta( 'theme-transparent-header-meta', 'default' );
|
||||
|
||||
if ( $enable_trans_header ) {
|
||||
|
||||
// Checking if the new 404 page setting option is enabled, if not then fetch the value from the old archive setting option to handle backward compatibility.
|
||||
if ( is_404() && '1' == astra_get_option( 'transparent-header-disable-404-page', astra_get_option( 'transparent-header-disable-archive' ) ) ) {
|
||||
$enable_trans_header = false;
|
||||
}
|
||||
|
||||
// Checking if the new search page setting option is enabled, if not then fetch the value from the old archive setting option to handle backward compatibility.
|
||||
if ( is_search() && '1' == astra_get_option( 'transparent-header-disable-search-page', astra_get_option( 'transparent-header-disable-archive' ) ) ) {
|
||||
$enable_trans_header = false;
|
||||
}
|
||||
|
||||
// Checking if the new archive pages setting option is enabled, if not then fetch the value from the old archive setting option to handle backward compatibility.
|
||||
if ( is_archive() && '1' == astra_get_option( 'transparent-header-disable-archive-pages', astra_get_option( 'transparent-header-disable-archive' ) ) ) {
|
||||
$enable_trans_header = false;
|
||||
}
|
||||
|
||||
if ( is_home() && '1' == astra_get_option( 'transparent-header-disable-index' ) && ( 'posts' !== get_option( 'show_on_front' ) ) ) {
|
||||
$enable_trans_header = false;
|
||||
}
|
||||
|
||||
if ( is_front_page() && 'posts' == get_option( 'show_on_front' ) && '1' == astra_get_option( 'transparent-header-disable-latest-posts-index' ) ) {
|
||||
$enable_trans_header = false;
|
||||
}
|
||||
|
||||
if ( is_page() && '1' == astra_get_option( 'transparent-header-disable-page' ) ) {
|
||||
$enable_trans_header = false;
|
||||
}
|
||||
|
||||
if ( is_single() && '1' == astra_get_option( 'transparent-header-disable-posts' ) ) {
|
||||
$enable_trans_header = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( class_exists( 'Astra_Woocommerce' ) ) {
|
||||
if ( is_product() && '1' == astra_get_option( 'transparent-header-disable-woo-products' ) ) {
|
||||
$enable_trans_header = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Force Meta settings to override global settings.
|
||||
if ( 'enabled' === $trans_meta_option ) {
|
||||
$enable_trans_header = true;
|
||||
} elseif ( 'disabled' === $trans_meta_option ) {
|
||||
$enable_trans_header = false;
|
||||
}
|
||||
|
||||
return apply_filters( 'astra_is_transparent_header', $enable_trans_header );
|
||||
}
|
||||
|
||||
/**
|
||||
* Site Header - <header>
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function transparent_header_logo() {
|
||||
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
$inherit_desk_logo = astra_get_option( 'different-transparent-logo', false );
|
||||
$transparent_header_logo = astra_get_option( 'transparent-header-logo' );
|
||||
|
||||
if ( self::is_transparent_header() && '1' == $inherit_desk_logo && '' !== $transparent_header_logo ) {
|
||||
// Logo For None Effect.
|
||||
add_filter( 'astra_has_custom_logo', '__return_true' );
|
||||
add_filter( 'get_custom_logo', array( $this, 'transparent_custom_logo' ), 10, 2 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replace transparent header logo.
|
||||
*
|
||||
* @param sting $html Size name.
|
||||
* @param int $blog_id Icon.
|
||||
*
|
||||
* @return string html markup of logo.
|
||||
*/
|
||||
public function transparent_custom_logo( $html, $blog_id ) {
|
||||
|
||||
$trans_logo = astra_get_option( 'transparent-header-logo' );
|
||||
$transparent_header_devices = astra_get_option( 'transparent-header-on-devices' );
|
||||
|
||||
if ( '' !== $trans_logo ) {
|
||||
|
||||
/* Replace transparent header logo and width */
|
||||
add_filter( 'wp_get_attachment_image_attributes', array( $this, 'replace_trans_header_attr' ), 10, 3 );
|
||||
|
||||
$custom_logo_id = attachment_url_to_postid( $trans_logo );
|
||||
|
||||
$size = 'ast-transparent-logo-size';
|
||||
|
||||
if ( is_customize_preview() ) {
|
||||
$size = 'full';
|
||||
}
|
||||
|
||||
$html = sprintf(
|
||||
'<a href="%1$s" class="custom-logo-link transparent-custom-logo" rel="home" itemprop="url" aria-label="%3$s">%2$s</a>',
|
||||
esc_url( home_url( '/' ) ),
|
||||
wp_get_attachment_image(
|
||||
$custom_logo_id,
|
||||
$size,
|
||||
false,
|
||||
array(
|
||||
'class' => 'custom-logo',
|
||||
)
|
||||
),
|
||||
get_bloginfo()
|
||||
);
|
||||
|
||||
if ( 'mobile' === $transparent_header_devices ) {
|
||||
|
||||
$html .= sprintf(
|
||||
'<a href="%1$s" class="custom-logo-link ast-transparent-desktop-logo" rel="home" itemprop="url">%2$s</a>',
|
||||
esc_url( home_url( '/' ) ),
|
||||
wp_get_attachment_image(
|
||||
get_theme_mod( 'custom_logo' ),
|
||||
$size,
|
||||
false,
|
||||
array(
|
||||
'class' => 'custom-logo',
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ( 'desktop' === $transparent_header_devices ) {
|
||||
|
||||
$html .= sprintf(
|
||||
'<a href="%1$s" class="custom-logo-link ast-transparent-mobile-logo" rel="home" itemprop="url">%2$s</a>',
|
||||
esc_url( home_url( '/' ) ),
|
||||
wp_get_attachment_image(
|
||||
get_theme_mod( 'custom_logo' ),
|
||||
$size,
|
||||
false,
|
||||
array(
|
||||
'class' => 'custom-logo',
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
remove_filter( 'wp_get_attachment_image_attributes', array( $this, 'replace_trans_header_attr' ) );
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Replace transparent header logo.
|
||||
*
|
||||
* @param array $attr Image.
|
||||
* @param object $attachment Image obj.
|
||||
* @param sting $size Size name.
|
||||
*
|
||||
* @return array Image attr.
|
||||
*/
|
||||
public function replace_trans_header_attr( $attr, $attachment, $size ) {
|
||||
|
||||
$trans_logo = astra_get_option( 'transparent-header-logo' );
|
||||
$custom_logo_id = attachment_url_to_postid( $trans_logo );
|
||||
|
||||
if ( $custom_logo_id == $attachment->ID ) {
|
||||
|
||||
$attach_data = array();
|
||||
if ( ! is_customize_preview() ) {
|
||||
$attach_data = wp_get_attachment_image_src( $attachment->ID, 'ast-transparent-logo-size' );
|
||||
if ( isset( $attach_data[0] ) ) {
|
||||
$attr['src'] = $attach_data[0];
|
||||
}
|
||||
}
|
||||
|
||||
$file_type = wp_check_filetype( $attr['src'] );
|
||||
$file_extension = $file_type['ext'];
|
||||
|
||||
if ( 'svg' == $file_extension ) {
|
||||
$attr['class'] = 'astra-logo-svg';
|
||||
}
|
||||
|
||||
$diff_retina_logo = astra_get_option( 'different-transparent-retina-logo' );
|
||||
|
||||
if ( '1' == $diff_retina_logo ) {
|
||||
|
||||
$retina_logo = astra_get_option( 'transparent-header-retina-logo' );
|
||||
|
||||
$attr['srcset'] = '';
|
||||
|
||||
if ( apply_filters( 'astra_transparent_header_retina', true ) && '' !== $retina_logo ) {
|
||||
$cutom_logo = wp_get_attachment_image_src( $custom_logo_id, 'full' );
|
||||
$cutom_logo_url = $cutom_logo[0];
|
||||
|
||||
if ( astra_check_is_ie() ) {
|
||||
// Replace header logo url to retina logo url.
|
||||
$attr['src'] = $retina_logo;
|
||||
}
|
||||
|
||||
$attr['srcset'] = $cutom_logo_url . ' 1x, ' . $retina_logo . ' 2x';
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $attr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Meta Options
|
||||
*
|
||||
* @param array $meta_option Page Meta.
|
||||
* @return array
|
||||
*/
|
||||
public function add_options( $meta_option ) {
|
||||
|
||||
$meta_option['theme-transparent-header-meta'] = array(
|
||||
'sanitize' => 'FILTER_SANITIZE_STRING',
|
||||
);
|
||||
|
||||
return $meta_option;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transparent Header Meta Field markup
|
||||
*
|
||||
* Loads appropriate template file based on the style option selected in options panel.
|
||||
*
|
||||
* @param array $meta Page Meta.
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function add_options_markup( $meta ) {
|
||||
|
||||
/**
|
||||
* Get options
|
||||
*/
|
||||
$trans_header_meta = ( isset( $meta['theme-transparent-header-meta']['default'] ) ) ? $meta['theme-transparent-header-meta']['default'] : 'default';
|
||||
$show_meta_field = ! astra_check_is_bb_themer_layout();
|
||||
?>
|
||||
|
||||
<?php if ( $show_meta_field ) { ?>
|
||||
<div class="transparent-header-wrapper">
|
||||
<p class="post-attributes-label-wrapper">
|
||||
<strong> <?php esc_html_e( 'Transparent Header', 'astra' ); ?> </strong><br/>
|
||||
</p>
|
||||
<select name="theme-transparent-header-meta" id="theme-transparent-header-meta">
|
||||
<option value="default" <?php selected( $trans_header_meta, 'default' ); ?>> <?php esc_html_e( 'Customizer Setting', 'astra' ); ?> </option>
|
||||
<option value="enabled" <?php selected( $trans_header_meta, 'enabled' ); ?>> <?php esc_html_e( 'Enabled', 'astra' ); ?> </option>
|
||||
<option value="disabled" <?php selected( $trans_header_meta, 'disabled' ); ?>> <?php esc_html_e( 'Disabled', 'astra' ); ?> </option>
|
||||
</select>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Styles Callback
|
||||
*/
|
||||
public function customizer_save() {
|
||||
|
||||
/* Generate Transparent Header Logo */
|
||||
$trans_logo = astra_get_option( 'transparent-header-logo' );
|
||||
|
||||
if ( '' !== $trans_logo ) {
|
||||
add_filter( 'intermediate_image_sizes_advanced', array( $this, 'transparent_logo_image_sizes' ), 10, 2 );
|
||||
$trans_logo_id = attachment_url_to_postid( $trans_logo );
|
||||
Astra_Customizer::generate_logo_by_width( $trans_logo_id );
|
||||
remove_filter( 'intermediate_image_sizes_advanced', array( $this, 'transparent_logo_image_sizes' ), 10 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add logo image sizes in filter.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @param array $sizes Sizes.
|
||||
* @param array $metadata attachment data.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function transparent_logo_image_sizes( $sizes, $metadata ) {
|
||||
|
||||
$logo_width = astra_get_option( 'transparent-header-logo-width' );
|
||||
|
||||
if ( is_array( $sizes ) && '' != $logo_width['desktop'] ) {
|
||||
$max_value = max( $logo_width );
|
||||
$sizes['ast-transparent-logo-size'] = array(
|
||||
'width' => (int) $max_value,
|
||||
'height' => 0,
|
||||
'crop' => false,
|
||||
);
|
||||
}
|
||||
|
||||
return $sizes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
Astra_Ext_Transparent_Header_Markup::get_instance();
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* Transparent Header Options for our theme.
|
||||
*
|
||||
* @package Astra Addon
|
||||
* @link https://www.brainstormforce.com
|
||||
* @since Astra 1.4.3
|
||||
*/
|
||||
|
||||
// Block direct access to the file.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Bail if Customizer config base class does not exist.
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes
|
||||
*
|
||||
* @since 1.4.3
|
||||
*/
|
||||
if ( ! class_exists( 'Astra_Transparent_Header_Panels_And_Sections' ) ) {
|
||||
|
||||
/**
|
||||
* Register Transparent Header Customizer Configurations.
|
||||
*/
|
||||
class Astra_Transparent_Header_Panels_And_Sections extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Transparent Header Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
array(
|
||||
'name' => 'section-transparent-header',
|
||||
'title' => esc_html__( 'Transparent Header', 'astra' ),
|
||||
'panel' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 'panel-header-builder-group' : 'panel-header-group',
|
||||
'type' => 'section',
|
||||
'priority' => 33,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'section-colors-header-group',
|
||||
'type' => 'section',
|
||||
'title' => esc_html__( 'Header', 'astra' ),
|
||||
'panel' => 'panel-colors-background',
|
||||
'priority' => 20,
|
||||
),
|
||||
);
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
new Astra_Transparent_Header_Panels_And_Sections();
|
||||
@@ -0,0 +1,616 @@
|
||||
<?php
|
||||
/**
|
||||
* Transparent Header - Dynamic CSS
|
||||
*
|
||||
* @package Astra
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
add_filter( 'astra_dynamic_theme_css', 'astra_ext_transparent_header_dynamic_css' );
|
||||
|
||||
/**
|
||||
* To avoid multiple Transparent color in submenu anchor tag.
|
||||
* Old Users - Will not reflect directly.
|
||||
* New Users - Will see the changes
|
||||
*
|
||||
* @return bool true|false.
|
||||
* @since 4.4.0
|
||||
*/
|
||||
function astra_has_submenu_transperent_styling() {
|
||||
$astra_settings = get_option( ASTRA_THEME_SETTINGS );
|
||||
return apply_filters( 'astra_submenu_anchor_transperent_style', isset( $astra_settings['v4-3-2-anchor_transperent_style'] ) ? false : true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get transparent header's last active row to process bottom border design accordingly.
|
||||
*
|
||||
* @param string $device Device type.
|
||||
*
|
||||
* @since 4.6.16
|
||||
* @return string
|
||||
*/
|
||||
function astra_get_transparent_header_last_active_row( $device ) {
|
||||
$selector = '';
|
||||
$prefix_sel = 'desktop' === $device ? '.ast-theme-transparent-header #ast-desktop-header > ' : '.ast-theme-transparent-header.ast-header-break-point #ast-mobile-header > ';
|
||||
$header_rows = array( 'above', 'primary', 'below' );
|
||||
|
||||
foreach ( $header_rows as $row ) {
|
||||
if ( ! Astra_Builder_Helper::is_row_empty( $row, 'header', $device ) ) {
|
||||
continue;
|
||||
}
|
||||
$selector = 'primary' === $row ? $prefix_sel . '.ast-main-header-wrap > .main-header-bar' : $prefix_sel . '.ast-' . $row . '-header-wrap > .ast-' . $row . '-header';
|
||||
}
|
||||
|
||||
return $selector;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dynamic CSS
|
||||
*
|
||||
* @param String $dynamic_css Astra Dynamic CSS.
|
||||
* @param String $dynamic_css_filtered Astra Dynamic CSS Filters.
|
||||
* @return String Dynamic CSS.
|
||||
*/
|
||||
function astra_ext_transparent_header_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
|
||||
|
||||
if ( true != Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) {
|
||||
return $dynamic_css;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set colors
|
||||
*
|
||||
* If colors extension is_active then get color from it.
|
||||
* Else set theme default colors.
|
||||
*/
|
||||
$transparent_header_separator = astra_get_option( 'transparent-header-main-sep' );
|
||||
$transparent_header_separator_color = astra_get_option( 'transparent-header-main-sep-color' );
|
||||
|
||||
$transparent_header_logo_width = astra_get_option( 'transparent-header-logo-width' );
|
||||
|
||||
$transparent_header_inherit = astra_get_option( 'different-transparent-logo' );
|
||||
$transparent_header_logo = astra_get_option( 'transparent-header-logo' );
|
||||
|
||||
$transparent_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'desktop' );
|
||||
$transparent_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'tablet', $transparent_bg_color_desktop );
|
||||
$transparent_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'mobile', ( $transparent_bg_color_tablet ) ? $transparent_bg_color_tablet : $transparent_bg_color_desktop );
|
||||
|
||||
// Above transparent header background color.
|
||||
$above_transparent_bg_color_desktop = astra_get_prop( astra_get_option( 'hba-transparent-header-bg-color-responsive' ), 'desktop' );
|
||||
$above_transparent_bg_color_tablet = astra_get_prop( astra_get_option( 'hba-transparent-header-bg-color-responsive' ), 'tablet', $above_transparent_bg_color_desktop );
|
||||
$above_transparent_bg_color_mobile = astra_get_prop( astra_get_option( 'hba-transparent-header-bg-color-responsive' ), 'mobile', ( $above_transparent_bg_color_tablet ) ? $above_transparent_bg_color_tablet : $above_transparent_bg_color_desktop );
|
||||
|
||||
// Below transparent header background color.
|
||||
$below_transparent_bg_color_desktop = astra_get_prop( astra_get_option( 'hbb-transparent-header-bg-color-responsive' ), 'desktop' );
|
||||
$below_transparent_bg_color_tablet = astra_get_prop( astra_get_option( 'hbb-transparent-header-bg-color-responsive' ), 'tablet', $below_transparent_bg_color_desktop );
|
||||
$below_transparent_bg_color_mobile = astra_get_prop( astra_get_option( 'hbb-transparent-header-bg-color-responsive' ), 'mobile', ( $below_transparent_bg_color_tablet ) ? $below_transparent_bg_color_tablet : $below_transparent_bg_color_desktop );
|
||||
|
||||
$transparent_color_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'desktop' );
|
||||
$transparent_color_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'tablet' );
|
||||
$transparent_color_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_color_h_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'desktop' );
|
||||
$transparent_color_h_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'tablet' );
|
||||
$transparent_color_h_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'desktop' );
|
||||
$transparent_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'desktop' );
|
||||
$transparent_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'desktop' );
|
||||
|
||||
$transparent_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'tablet' );
|
||||
$transparent_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'tablet' );
|
||||
$transparent_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'tablet' );
|
||||
|
||||
$transparent_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'mobile' );
|
||||
$transparent_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'mobile' );
|
||||
$transparent_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_sub_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'desktop' );
|
||||
$transparent_sub_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'desktop' );
|
||||
$transparent_sub_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'desktop' );
|
||||
|
||||
$transparent_sub_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'tablet' );
|
||||
$transparent_sub_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'tablet' );
|
||||
$transparent_sub_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'tablet' );
|
||||
|
||||
$transparent_sub_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'mobile' );
|
||||
$transparent_sub_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'mobile' );
|
||||
$transparent_sub_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_content_section_text_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'desktop' );
|
||||
$transparent_content_section_link_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'desktop' );
|
||||
$transparent_content_section_link_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'desktop' );
|
||||
|
||||
$transparent_content_section_text_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'tablet' );
|
||||
$transparent_content_section_link_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'tablet' );
|
||||
$transparent_content_section_link_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'tablet' );
|
||||
|
||||
$transparent_content_section_text_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'mobile' );
|
||||
$transparent_content_section_link_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'mobile' );
|
||||
$transparent_content_section_link_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_header_devices = astra_get_option( 'transparent-header-on-devices' );
|
||||
|
||||
/**
|
||||
* Generate Dynamic CSS
|
||||
*/
|
||||
|
||||
$css = '';
|
||||
|
||||
if ( '0' === $transparent_header_inherit && '' != $transparent_header_logo ) {
|
||||
$css_output = array(
|
||||
'.ast-theme-transparent-header .site-logo-img .custom-logo-link' => array(
|
||||
'display' => 'none',
|
||||
),
|
||||
);
|
||||
$css .= astra_parse_css( $css_output );
|
||||
}
|
||||
|
||||
// Handle style guide logo background cases inside the customizer.
|
||||
if ( is_customize_preview() ) {
|
||||
if ( Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) {
|
||||
// Fetch the header items
|
||||
$header_items = astra_get_option( 'header-desktop-items', array() );
|
||||
|
||||
$transparent_bg_colors = array(
|
||||
'above' => $above_transparent_bg_color_desktop,
|
||||
'primary' => $transparent_bg_color_desktop,
|
||||
'below' => $below_transparent_bg_color_desktop,
|
||||
);
|
||||
|
||||
$transparent_bg_color = ! empty( $transparent_bg_color_desktop ) ? esc_attr( $transparent_bg_color_desktop ) : 'black';
|
||||
|
||||
foreach ( $transparent_bg_colors as $section => $bg_color ) {
|
||||
if ( isset( $header_items[ $section ] ) && astra_is_logo_in_section( $header_items[ $section ] ) ) {
|
||||
$transparent_bg_color = ! empty( $bg_color ) ? esc_attr( $bg_color ) : '#d1d5db';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$transparent_header_desktop_bg = array(
|
||||
'.ast-theme-transparent-header .ast-sg-element-wrap.ast-sg-logo-section' => array(
|
||||
'background-color' => $transparent_bg_color,
|
||||
),
|
||||
);
|
||||
|
||||
$css .= astra_parse_css( $transparent_header_desktop_bg );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Desktop Transparent Heder Logo Width.
|
||||
$css_output = array(
|
||||
'.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg' => array(
|
||||
'width' => astra_get_css_value( $transparent_header_logo_width['desktop'], 'px' ),
|
||||
'height' => astra_get_css_value( ( ! empty( $transparent_header_logo_width['desktop-svg-height'] ) && ! is_customize_preview() ) ? $transparent_header_logo_width['desktop-svg-height'] : '', 'px' ),
|
||||
),
|
||||
'.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img' => array(
|
||||
' max-width' => astra_get_css_value( $transparent_header_logo_width['desktop'], 'px' ),
|
||||
' width' => astra_get_css_value( $transparent_header_logo_width['desktop'], 'px' ),
|
||||
),
|
||||
);
|
||||
$css .= astra_parse_css( $css_output );
|
||||
|
||||
// Tablet Transparent Heder Logo Width.
|
||||
$tablet_css_output = array(
|
||||
'.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg' => array(
|
||||
'width' => astra_get_css_value( $transparent_header_logo_width['tablet'], 'px' ),
|
||||
'height' => astra_get_css_value( ( ! empty( $transparent_header_logo_width['tablet-svg-height'] ) && ! is_customize_preview() ) ? $transparent_header_logo_width['tablet-svg-height'] : '', 'px' ),
|
||||
),
|
||||
'.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img' => array(
|
||||
' max-width' => astra_get_css_value( $transparent_header_logo_width['tablet'], 'px' ),
|
||||
' width' => astra_get_css_value( $transparent_header_logo_width['tablet'], 'px' ),
|
||||
),
|
||||
);
|
||||
$css .= astra_parse_css( $tablet_css_output, '', astra_get_tablet_breakpoint() );
|
||||
|
||||
// Mobile Transparent Heder Logo Width.
|
||||
$mobile_css_output = array(
|
||||
'.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg' => array(
|
||||
'width' => astra_get_css_value( $transparent_header_logo_width['mobile'], 'px' ),
|
||||
'height' => astra_get_css_value( ( ! empty( $transparent_header_logo_width['mobile-svg-height'] ) && ! is_customize_preview() ) ? $transparent_header_logo_width['mobile-svg-height'] : '', 'px' ),
|
||||
),
|
||||
'.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img' => array(
|
||||
' max-width' => astra_get_css_value( $transparent_header_logo_width['mobile'], 'px' ),
|
||||
' width' => astra_get_css_value( $transparent_header_logo_width['mobile'], 'px' ),
|
||||
),
|
||||
);
|
||||
$css .= astra_parse_css( $mobile_css_output, '', astra_get_mobile_breakpoint( 1 ) );
|
||||
|
||||
$transparent_header_base = array(
|
||||
'.ast-theme-transparent-header #masthead' => array(
|
||||
'position' => 'absolute',
|
||||
'left' => '0',
|
||||
'right' => '0',
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar' => array(
|
||||
'background' => 'none',
|
||||
),
|
||||
|
||||
'body.elementor-editor-active.ast-theme-transparent-header #masthead, .fl-builder-edit .ast-theme-transparent-header #masthead, body.vc_editor.ast-theme-transparent-header #masthead, body.brz-ed.ast-theme-transparent-header #masthead' => array(
|
||||
'z-index' => '0',
|
||||
),
|
||||
|
||||
'.ast-header-break-point.ast-replace-site-logo-transparent.ast-theme-transparent-header .custom-mobile-logo-link' => array(
|
||||
'display' => 'none',
|
||||
),
|
||||
|
||||
'.ast-header-break-point.ast-replace-site-logo-transparent.ast-theme-transparent-header .transparent-custom-logo' => array(
|
||||
'display' => 'inline-block',
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-above-header, .ast-theme-transparent-header .ast-above-header.ast-above-header-bar' => array(
|
||||
'background-image' => 'none',
|
||||
'background-color' => 'transparent',
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header, .ast-theme-transparent-header .ast-below-header.ast-below-header-bar' => array(
|
||||
'background-image' => 'none',
|
||||
'background-color' => 'transparent',
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Transparent Header Colors
|
||||
*/
|
||||
$transparent_header_desktop = array(
|
||||
|
||||
'.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .ast-mobile-header-wrap .main-header-bar' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .main-header-bar .ast-search-menu-icon form' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header, .ast-theme-transparent-header .ast-above-header.ast-above-header-bar' => array(
|
||||
'background-color' => esc_attr( $above_transparent_bg_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-below-header, .ast-theme-transparent-header .ast-below-header.ast-below-header-bar' => array(
|
||||
'background-color' => esc_attr( $below_transparent_bg_color_desktop ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited' => array(
|
||||
'color' => esc_attr( $transparent_color_site_title_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .site-header .site-title a:hover' => array(
|
||||
'color' => esc_attr( $transparent_color_h_site_title_desktop ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .site-header .site-description' => array(
|
||||
'color' => esc_attr( $transparent_color_site_title_desktop ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' => array(
|
||||
'background-color' => esc_attr( $transparent_menu_bg_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu' => array(
|
||||
'background-color' => esc_attr( $transparent_sub_menu_bg_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .main-header-menu .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_desktop ),
|
||||
),
|
||||
// Content Section text color.
|
||||
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' => array(
|
||||
'color' => esc_attr( $transparent_content_section_text_color_desktop ),
|
||||
),
|
||||
// Content Section link color.
|
||||
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element a' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_color_desktop ),
|
||||
),
|
||||
// Content Section link hover color.
|
||||
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element a:hover' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_h_color_desktop ),
|
||||
),
|
||||
);
|
||||
|
||||
if ( astra_has_submenu_transperent_styling() ) {
|
||||
$transparent_header_desktop['.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link'] = array(
|
||||
'background-color' => 'transparent',
|
||||
);
|
||||
}
|
||||
$transparent_header_tablet = array(
|
||||
|
||||
'.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .ast-mobile-header-wrap .main-header-bar' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .main-header-bar .ast-search-menu-icon form' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header.ast-header-break-point .ast-above-header, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-bar .main-header-menu' => array(
|
||||
'background-color' => esc_attr( $above_transparent_bg_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header.ast-header-break-point .ast-below-header, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-bar .main-header-menu' => array(
|
||||
'background-color' => esc_attr( $below_transparent_bg_color_tablet ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:hover, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:focus, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:visited' => array(
|
||||
'color' => esc_attr( $transparent_color_site_title_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .site-header .site-title a:hover' => array(
|
||||
'color' => esc_attr( $transparent_color_h_site_title_tablet ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .site-header .site-description' => array(
|
||||
'color' => esc_attr( $transparent_color_site_title_tablet ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu .sub-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' => array(
|
||||
'background-color' => esc_attr( $transparent_menu_bg_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu' => array(
|
||||
'background-color' => esc_attr( $transparent_sub_menu_bg_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_tablet ),
|
||||
),
|
||||
// Content Section text color.
|
||||
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' => array(
|
||||
'color' => esc_attr( $transparent_content_section_text_color_tablet ),
|
||||
),
|
||||
// Content Section link color.
|
||||
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_color_tablet ),
|
||||
),
|
||||
// Content Section link hover color.
|
||||
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_h_color_tablet ),
|
||||
),
|
||||
);
|
||||
|
||||
$transparent_header_mobile = array(
|
||||
|
||||
'.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .ast-mobile-header-wrap .main-header-bar' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .main-header-bar .ast-search-menu-icon form' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header.ast-header-break-point .ast-above-header, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-bar .main-header-menu' => array(
|
||||
'background-color' => esc_attr( $above_transparent_bg_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header.ast-header-break-point .ast-below-header, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-bar .main-header-menu' => array(
|
||||
'background-color' => esc_attr( $below_transparent_bg_color_mobile ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:hover, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:focus, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:visited' => array(
|
||||
'color' => esc_attr( $transparent_color_site_title_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .site-header .site-title a:hover' => array(
|
||||
'color' => esc_attr( $transparent_color_h_site_title_mobile ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .site-header .site-description' => array(
|
||||
'color' => esc_attr( $transparent_color_site_title_mobile ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu .sub-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' => array(
|
||||
'background-color' => esc_attr( $transparent_menu_bg_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu' => array(
|
||||
'background-color' => esc_attr( $transparent_sub_menu_bg_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_mobile ),
|
||||
),
|
||||
// Content Section text color.
|
||||
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' => array(
|
||||
'color' => esc_attr( $transparent_content_section_text_color_mobile ),
|
||||
),
|
||||
// Content Section link color.
|
||||
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_color_mobile ),
|
||||
),
|
||||
// Content Section link hover color.
|
||||
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_h_color_mobile ),
|
||||
),
|
||||
);
|
||||
|
||||
/* Parse CSS from array() */
|
||||
if ( 'both' === $transparent_header_devices || 'desktop' === $transparent_header_devices ) {
|
||||
$css .= astra_parse_css( $transparent_header_base, strval( astra_get_tablet_breakpoint() ) );
|
||||
|
||||
// If Transparent header is active on mobile + desktop, enqueue CSS without media queeries.
|
||||
// If only for desktop add media query for the transparent header.
|
||||
if ( 'both' === $transparent_header_devices ) {
|
||||
$css .= astra_parse_css( $transparent_header_desktop );
|
||||
} else {
|
||||
$css .= astra_parse_css( $transparent_header_desktop, astra_get_tablet_breakpoint( '', 1 ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'mobile' === $transparent_header_devices ) {
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
'.transparent-custom-logo' => array(
|
||||
'display' => 'none',
|
||||
),
|
||||
),
|
||||
astra_get_tablet_breakpoint()
|
||||
);
|
||||
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
'.transparent-custom-logo' => array(
|
||||
'display' => 'block',
|
||||
),
|
||||
),
|
||||
'',
|
||||
astra_get_tablet_breakpoint()
|
||||
);
|
||||
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
'.ast-transparent-desktop-logo' => array(
|
||||
'display' => 'none',
|
||||
),
|
||||
),
|
||||
'',
|
||||
astra_get_tablet_breakpoint()
|
||||
);
|
||||
}
|
||||
|
||||
if ( 'desktop' === $transparent_header_devices ) {
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
'.transparent-custom-logo' => array(
|
||||
'display' => 'none',
|
||||
),
|
||||
),
|
||||
'',
|
||||
astra_get_tablet_breakpoint()
|
||||
);
|
||||
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
'.ast-transparent-mobile-logo' => array(
|
||||
'display' => 'none',
|
||||
),
|
||||
),
|
||||
astra_get_tablet_breakpoint()
|
||||
);
|
||||
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
'.ast-transparent-mobile-logo' => array(
|
||||
'display' => 'block',
|
||||
),
|
||||
),
|
||||
'',
|
||||
astra_get_tablet_breakpoint( 1 )
|
||||
);
|
||||
}
|
||||
|
||||
if ( 'both' === $transparent_header_devices || 'mobile' === $transparent_header_devices ) {
|
||||
$css .= astra_parse_css( $transparent_header_base, '', astra_get_tablet_breakpoint() );
|
||||
$css .= astra_parse_css( $transparent_header_tablet, '', astra_get_tablet_breakpoint() );
|
||||
$css .= astra_parse_css( $transparent_header_mobile, '', astra_get_mobile_breakpoint() );
|
||||
}
|
||||
|
||||
if ( 'both' === $transparent_header_devices ) {
|
||||
|
||||
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
|
||||
$desktop_selector = astra_get_transparent_header_last_active_row( 'desktop' );
|
||||
$responsive_selector = astra_get_transparent_header_last_active_row( 'mobile' );
|
||||
|
||||
// Join $desktop_selector & $responsive_selector.
|
||||
$selector = ( ! empty( $desktop_selector ) && ! empty( $responsive_selector ) ) ? $desktop_selector . ', ' . $responsive_selector : $desktop_selector . $responsive_selector;
|
||||
} else {
|
||||
$selector = '.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar';
|
||||
}
|
||||
|
||||
if ( '' !== $transparent_header_separator && 'inherit' !== $transparent_header_separator ) {
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
$selector => array(
|
||||
'border-bottom-width' => astra_get_css_value( $transparent_header_separator, 'px' ),
|
||||
'border-bottom-style' => 'solid',
|
||||
'border-bottom-color' => esc_attr( $transparent_header_separator_color ),
|
||||
),
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
$selector => array(
|
||||
'border-bottom-style' => 'none',
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'mobile' === $transparent_header_devices ) {
|
||||
|
||||
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
|
||||
$selector = astra_get_transparent_header_last_active_row( 'mobile' );
|
||||
} else {
|
||||
$selector = '.ast-theme-transparent-header.ast-header-break-point .main-header-bar';
|
||||
}
|
||||
|
||||
if ( '' !== $transparent_header_separator && 'inherit' !== $transparent_header_separator ) {
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
$selector => array(
|
||||
'border-bottom-width' => astra_get_css_value( $transparent_header_separator, 'px' ),
|
||||
'border-bottom-style' => 'solid',
|
||||
'border-bottom-color' => esc_attr( $transparent_header_separator_color ),
|
||||
),
|
||||
),
|
||||
'',
|
||||
astra_get_tablet_breakpoint()
|
||||
);
|
||||
} else {
|
||||
$css .= astra_parse_css(
|
||||
array(
|
||||
$selector => array(
|
||||
'border-bottom-style' => 'none',
|
||||
),
|
||||
),
|
||||
'',
|
||||
astra_get_tablet_breakpoint()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'desktop' === $transparent_header_devices ) {
|
||||
|
||||
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
|
||||
$selector = astra_get_transparent_header_last_active_row( 'desktop' );
|
||||
} else {
|
||||
$selector = '.ast-theme-transparent-header .main-header-bar';
|
||||
}
|
||||
|
||||
if ( '' !== $transparent_header_separator && 'inherit' !== $transparent_header_separator ) {
|
||||
$transparent_header_base = array(
|
||||
$selector => array(
|
||||
'border-bottom-width' => astra_get_css_value( $transparent_header_separator, 'px' ),
|
||||
'border-bottom-style' => 'solid',
|
||||
'border-bottom-color' => esc_attr( $transparent_header_separator_color ),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
$transparent_header_base = array(
|
||||
$selector => array(
|
||||
'border-bottom-style' => 'none',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$css .= astra_parse_css( $transparent_header_base, strval( astra_get_tablet_breakpoint() ) );
|
||||
}
|
||||
|
||||
$dynamic_css .= $css;
|
||||
|
||||
return $dynamic_css;
|
||||
}
|
||||
@@ -0,0 +1,561 @@
|
||||
<?php
|
||||
/**
|
||||
* Transparent Header - Dynamic CSS
|
||||
*
|
||||
* @package Astra
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Transparent Above Header
|
||||
*/
|
||||
add_filter( 'astra_dynamic_theme_css', 'astra_ext_transparent_above_header_sections_dynamic_css' );
|
||||
|
||||
/**
|
||||
* Dynamic CSS
|
||||
*
|
||||
* @param string $dynamic_css Astra Dynamic CSS.
|
||||
* @param string $dynamic_css_filtered Astra Dynamic CSS Filters.
|
||||
* @return String Generated dynamic CSS for above header transparent header.
|
||||
*/
|
||||
function astra_ext_transparent_above_header_sections_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
|
||||
|
||||
$above_header_layout = astra_get_option( 'above-header-layout', 'disabled' );
|
||||
|
||||
if ( 'disabled' === $above_header_layout ) {
|
||||
return $dynamic_css;
|
||||
}
|
||||
|
||||
if ( false == Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) {
|
||||
return $dynamic_css;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set colors
|
||||
*/
|
||||
|
||||
$transparent_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'desktop' );
|
||||
$transparent_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'tablet' );
|
||||
$transparent_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_color_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'desktop' );
|
||||
$transparent_color_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'tablet' );
|
||||
$transparent_color_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_color_h_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'desktop' );
|
||||
$transparent_color_h_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'tablet' );
|
||||
$transparent_color_h_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'desktop' );
|
||||
$transparent_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'desktop' );
|
||||
$transparent_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'desktop' );
|
||||
|
||||
$transparent_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'tablet' );
|
||||
$transparent_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'tablet' );
|
||||
$transparent_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'tablet' );
|
||||
|
||||
$transparent_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'mobile' );
|
||||
$transparent_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'mobile' );
|
||||
$transparent_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_sub_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'desktop' );
|
||||
$transparent_sub_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'desktop' );
|
||||
$transparent_sub_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'desktop' );
|
||||
|
||||
$transparent_sub_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'tablet' );
|
||||
$transparent_sub_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'tablet' );
|
||||
$transparent_sub_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'tablet' );
|
||||
|
||||
$transparent_sub_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'mobile' );
|
||||
$transparent_sub_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'mobile' );
|
||||
$transparent_sub_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_content_section_text_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'desktop' );
|
||||
$transparent_content_section_link_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'desktop' );
|
||||
$transparent_content_section_link_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'desktop' );
|
||||
|
||||
$transparent_content_section_text_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'tablet' );
|
||||
$transparent_content_section_link_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'tablet' );
|
||||
$transparent_content_section_link_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'tablet' );
|
||||
|
||||
$transparent_content_section_text_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'mobile' );
|
||||
$transparent_content_section_link_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'mobile' );
|
||||
$transparent_content_section_link_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'mobile' );
|
||||
|
||||
/**
|
||||
* Generate Dynamic CSS
|
||||
*/
|
||||
|
||||
$css = '';
|
||||
/**
|
||||
* Transparent Header Colors
|
||||
*/
|
||||
$transparent_header_desktop = array(
|
||||
'.ast-theme-transparent-header .ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-section-separated .ast-above-header-navigation ul.ast-above-header-menu' => array(
|
||||
'background-color' => esc_attr( $transparent_menu_bg_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header .ast-search-menu-icon form' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header .slide-search .search-field' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header .slide-search .search-field:focus' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_desktop ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_desktop ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' => array(
|
||||
'color' => esc_attr( $transparent_menu_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu' => array(
|
||||
'background-color' => esc_attr( $transparent_sub_menu_bg_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_desktop ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_color_desktop ),
|
||||
),
|
||||
|
||||
// Content Section text color.
|
||||
'.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' => array(
|
||||
'color' => esc_attr( $transparent_content_section_text_color_desktop ),
|
||||
),
|
||||
// Content Section link color.
|
||||
'.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_color_desktop ),
|
||||
),
|
||||
// Content Section link hover color.
|
||||
'.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_h_color_desktop ),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
$transparent_header_tablet = array(
|
||||
'.ast-theme-transparent-header .ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-section-separated .ast-above-header-navigation ul.ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-section-separated .ast-below-header-actual-nav' => array(
|
||||
'background-color' => esc_attr( $transparent_menu_bg_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header .ast-search-menu-icon form' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header .slide-search .search-field' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header .slide-search .search-field:focus' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_tablet ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_tablet ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' => array(
|
||||
'color' => esc_attr( $transparent_menu_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu' => array(
|
||||
'background-color' => esc_attr( $transparent_sub_menu_bg_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_tablet ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_color_tablet ),
|
||||
),
|
||||
|
||||
// Content Section text color.
|
||||
'.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' => array(
|
||||
'color' => esc_attr( $transparent_content_section_text_color_tablet ),
|
||||
),
|
||||
// Content Section link color.
|
||||
'.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_color_tablet ),
|
||||
),
|
||||
// Content Section link hover color.
|
||||
'.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_h_color_tablet ),
|
||||
),
|
||||
);
|
||||
|
||||
$transparent_header_mobile = array(
|
||||
'.ast-theme-transparent-header .ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-section-separated .ast-above-header-navigation ul.ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-section-separated .ast-below-header-actual-nav' => array(
|
||||
'background-color' => esc_attr( $transparent_menu_bg_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header .ast-search-menu-icon form' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header .slide-search .search-field' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header .slide-search .search-field:focus' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_mobile ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_mobile ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' => array(
|
||||
'color' => esc_attr( $transparent_menu_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu' => array(
|
||||
'background-color' => esc_attr( $transparent_sub_menu_bg_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_mobile ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_color_mobile ),
|
||||
),
|
||||
|
||||
// Content Section text color.
|
||||
'.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' => array(
|
||||
'color' => esc_attr( $transparent_content_section_text_color_mobile ),
|
||||
),
|
||||
// Content Section link color.
|
||||
'.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_color_mobile ),
|
||||
),
|
||||
// Content Section link hover color.
|
||||
'.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_h_color_mobile ),
|
||||
),
|
||||
);
|
||||
|
||||
/* Parse CSS from array() */
|
||||
$css .= astra_parse_css( $transparent_header_desktop );
|
||||
$css .= astra_parse_css( $transparent_header_tablet, '', astra_get_tablet_breakpoint() );
|
||||
$css .= astra_parse_css( $transparent_header_mobile, '', astra_get_mobile_breakpoint() );
|
||||
|
||||
return $dynamic_css . $css;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Transparent Below Header
|
||||
*/
|
||||
add_filter( 'astra_dynamic_theme_css', 'astra_ext_transparent_below_header_sections_dynamic_css' );
|
||||
|
||||
/**
|
||||
* Dynamic CSS
|
||||
*
|
||||
* @param string $dynamic_css Astra Dynamic CSS.
|
||||
* @param string $dynamic_css_filtered Astra Dynamic CSS Filters.
|
||||
* @return String Generated dynamic CSS.
|
||||
*/
|
||||
function astra_ext_transparent_below_header_sections_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
|
||||
|
||||
// set page width depending on site layout.
|
||||
$below_header_layout = astra_get_option( 'below-header-layout', 'disabled' );
|
||||
|
||||
if ( 'disabled' === $below_header_layout ) {
|
||||
return $dynamic_css;
|
||||
}
|
||||
|
||||
if ( false == Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) {
|
||||
return $dynamic_css;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set colors
|
||||
*/
|
||||
|
||||
$transparent_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'desktop' );
|
||||
$transparent_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'tablet' );
|
||||
$transparent_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_color_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'desktop' );
|
||||
$transparent_color_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'tablet' );
|
||||
$transparent_color_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_color_h_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'desktop' );
|
||||
$transparent_color_h_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'tablet' );
|
||||
$transparent_color_h_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'desktop' );
|
||||
$transparent_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'desktop' );
|
||||
$transparent_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'desktop' );
|
||||
|
||||
$transparent_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'tablet' );
|
||||
$transparent_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'tablet' );
|
||||
$transparent_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'tablet' );
|
||||
|
||||
$transparent_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'mobile' );
|
||||
$transparent_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'mobile' );
|
||||
$transparent_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_sub_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'desktop' );
|
||||
$transparent_sub_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'desktop' );
|
||||
$transparent_sub_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'desktop' );
|
||||
|
||||
$transparent_sub_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'tablet' );
|
||||
$transparent_sub_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'tablet' );
|
||||
$transparent_sub_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'tablet' );
|
||||
|
||||
$transparent_sub_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'mobile' );
|
||||
$transparent_sub_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'mobile' );
|
||||
$transparent_sub_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'mobile' );
|
||||
|
||||
$transparent_content_section_text_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'desktop' );
|
||||
$transparent_content_section_link_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'desktop' );
|
||||
$transparent_content_section_link_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'desktop' );
|
||||
|
||||
$transparent_content_section_text_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'tablet' );
|
||||
$transparent_content_section_link_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'tablet' );
|
||||
$transparent_content_section_link_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'tablet' );
|
||||
|
||||
$transparent_content_section_text_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'mobile' );
|
||||
$transparent_content_section_link_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'mobile' );
|
||||
$transparent_content_section_link_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'mobile' );
|
||||
|
||||
/**
|
||||
* Generate Dynamic CSS
|
||||
*/
|
||||
|
||||
$css = '';
|
||||
/**
|
||||
* Transparent Header Colors
|
||||
*/
|
||||
$transparent_header_desktop = array(
|
||||
'.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav' => array(
|
||||
'background-color' => esc_attr( $transparent_menu_bg_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-below-header .ast-search-menu-icon form' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-below-header .slide-search .search-field' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_desktop ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-below-header .slide-search .search-field:focus' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_desktop ),
|
||||
),
|
||||
/**
|
||||
* Below Header Navigation
|
||||
*/
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' => array(
|
||||
'color' => esc_attr( $transparent_menu_color_desktop ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_desktop ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_desktop ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Below Header Dropdown Navigation
|
||||
*/
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_desktop ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_desktop ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu' => array(
|
||||
'background-color' => esc_attr( $transparent_sub_menu_bg_color_desktop ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_color_desktop ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Content Colors & Typography
|
||||
*/
|
||||
'.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' => array(
|
||||
'color' => esc_attr( $transparent_content_section_text_color_desktop ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_color_desktop ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_h_color_desktop ),
|
||||
),
|
||||
);
|
||||
|
||||
$transparent_header_tablet = array(
|
||||
|
||||
'.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav' => array(
|
||||
'background-color' => esc_attr( $transparent_menu_bg_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-below-header .ast-search-menu-icon form' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-below-header .slide-search .search-field' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_tablet ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-below-header .slide-search .search-field:focus' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_tablet ),
|
||||
),
|
||||
/**
|
||||
* Below Header Navigation
|
||||
*/
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' => array(
|
||||
'color' => esc_attr( $transparent_menu_color_tablet ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_tablet ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_tablet ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Below Header Dropdown Navigation
|
||||
*/
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_tablet ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_tablet ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu' => array(
|
||||
'background-color' => esc_attr( $transparent_sub_menu_bg_color_tablet ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_color_tablet ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Content Colors & Typography
|
||||
*/
|
||||
'.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' => array(
|
||||
'color' => esc_attr( $transparent_content_section_text_color_tablet ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_color_tablet ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_h_color_tablet ),
|
||||
),
|
||||
);
|
||||
|
||||
$transparent_header_mobile = array(
|
||||
|
||||
'.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav' => array(
|
||||
'background-color' => esc_attr( $transparent_menu_bg_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-below-header .ast-search-menu-icon form' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-below-header .slide-search .search-field' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_mobile ),
|
||||
),
|
||||
'.ast-theme-transparent-header .ast-below-header .slide-search .search-field:focus' => array(
|
||||
'background-color' => esc_attr( $transparent_bg_color_mobile ),
|
||||
),
|
||||
/**
|
||||
* Below Header Navigation
|
||||
*/
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' => array(
|
||||
'color' => esc_attr( $transparent_menu_color_mobile ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_mobile ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array(
|
||||
'color' => esc_attr( $transparent_menu_h_color_mobile ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Below Header Dropdown Navigation
|
||||
*/
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_mobile ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_h_color_mobile ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu' => array(
|
||||
'background-color' => esc_attr( $transparent_sub_menu_bg_color_mobile ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' => array(
|
||||
'color' => esc_attr( $transparent_sub_menu_color_mobile ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Content Colors & Typography
|
||||
*/
|
||||
'.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' => array(
|
||||
'color' => esc_attr( $transparent_content_section_text_color_mobile ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_color_mobile ),
|
||||
),
|
||||
|
||||
'.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' => array(
|
||||
'color' => esc_attr( $transparent_content_section_link_h_color_mobile ),
|
||||
),
|
||||
);
|
||||
|
||||
/* Parse CSS from array() */
|
||||
$css .= astra_parse_css( $transparent_header_desktop );
|
||||
$css .= astra_parse_css( $transparent_header_tablet, '', astra_get_tablet_breakpoint() );
|
||||
$css .= astra_parse_css( $transparent_header_mobile, '', astra_get_mobile_breakpoint() );
|
||||
|
||||
return $dynamic_css . $css;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Index file
|
||||
*
|
||||
* @package Astra
|
||||
* @since Astra 1.0.0
|
||||
*/
|
||||
|
||||
/* Silence is golden, and we agree. */
|
||||
@@ -0,0 +1,308 @@
|
||||
<?php
|
||||
/**
|
||||
* Colors and Background - Header Options for our theme.
|
||||
*
|
||||
* @package Astra Addon
|
||||
* @link https://www.brainstormforce.com
|
||||
* @since Astra 1.4.3
|
||||
*/
|
||||
|
||||
// Block direct access to the file.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Bail if Customizer config base class does not exist.
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes
|
||||
*
|
||||
* @since 1.4.3
|
||||
*/
|
||||
if ( ! class_exists( 'Astra_Customizer_Colors_Transparent_Header_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Colors and Background - Header Options Customizer Configurations.
|
||||
*/
|
||||
class Astra_Customizer_Colors_Transparent_Header_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Colors and Background - Header Options Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Option: Transparent Header logo color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-logo-color]',
|
||||
'default' => astra_get_option( 'transparent-header-logo-color' ),
|
||||
'section' => 'section-transparent-header',
|
||||
'type' => 'control',
|
||||
'priority' => 34,
|
||||
'control' => 'ast-color',
|
||||
'title' => __( 'Logo Color', 'astra' ),
|
||||
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
|
||||
'responsive' => false,
|
||||
'rgba' => true,
|
||||
'description' => __( 'Use it with transparent images for optimal results.', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Above header background overlay color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-transparent-header-bg-color-responsive]',
|
||||
'default' => astra_get_option( 'hba-transparent-header-bg-color-responsive' ),
|
||||
'section' => 'section-transparent-header',
|
||||
'type' => 'control',
|
||||
'priority' => 34,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'title' => __( 'Above Header', 'astra' ),
|
||||
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'divider' => array(
|
||||
'ast_class' => 'ast-top-divider ast-top-dotted-divider',
|
||||
'ast_title' => __( 'Background Overlay', 'astra' ),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header background overlay color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-bg-color-responsive]',
|
||||
'default' => astra_get_option( 'transparent-header-bg-color-responsive' ),
|
||||
'section' => 'section-transparent-header',
|
||||
'type' => 'control',
|
||||
'priority' => 34,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'title' => __( 'Primary Header', 'astra' ),
|
||||
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Below header background overlay color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-transparent-header-bg-color-responsive]',
|
||||
'default' => astra_get_option( 'hbb-transparent-header-bg-color-responsive' ),
|
||||
'section' => 'section-transparent-header',
|
||||
'type' => 'control',
|
||||
'priority' => 34,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'title' => __( 'Below Header', 'astra' ),
|
||||
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Site Title Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'transparent-header-color-site-title-responsive',
|
||||
'default' => astra_get_option( 'transparent-header-color-site-title-responsive' ),
|
||||
'type' => 'sub-control',
|
||||
'priority' => 1,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors]',
|
||||
'section' => 'section-transparent-header',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Site Title Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'transparent-header-color-h-site-title-responsive',
|
||||
'default' => astra_get_option( 'transparent-header-color-h-site-title-responsive' ),
|
||||
'type' => 'sub-control',
|
||||
'priority' => 1,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors]',
|
||||
'section' => 'section-transparent-header',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Menu Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'transparent-menu-color-responsive',
|
||||
'default' => astra_get_option( 'transparent-menu-color-responsive' ),
|
||||
'type' => 'sub-control',
|
||||
'priority' => 2,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-menu]',
|
||||
'section' => 'section-transparent-header',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Menu Background Color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[transparent-menu-bg-color-responsive]',
|
||||
'default' => astra_get_option( 'transparent-menu-bg-color-responsive' ),
|
||||
'type' => 'control',
|
||||
'priority' => 36,
|
||||
'section' => 'section-transparent-header',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'title' => __( 'Background', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Menu Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'transparent-menu-h-color-responsive',
|
||||
'default' => astra_get_option( 'transparent-menu-h-color-responsive' ),
|
||||
'type' => 'sub-control',
|
||||
'priority' => 3,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-menu]',
|
||||
'section' => 'section-transparent-header',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'title' => __( 'Hover / Active', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Sub menu text color.
|
||||
*/
|
||||
array(
|
||||
'name' => 'transparent-submenu-color-responsive',
|
||||
'default' => astra_get_option( 'transparent-submenu-color-responsive' ),
|
||||
'type' => 'sub-control',
|
||||
'priority' => 3,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-submenu]',
|
||||
'section' => 'section-transparent-header',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Sub menu background color.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[transparent-submenu-bg-color-responsive]',
|
||||
'default' => astra_get_option( 'transparent-submenu-bg-color-responsive' ),
|
||||
'type' => 'control',
|
||||
'priority' => 38,
|
||||
'section' => 'section-transparent-header',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'title' => __( 'Background', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Sub menu active hover color.
|
||||
*/
|
||||
array(
|
||||
'name' => 'transparent-submenu-h-color-responsive',
|
||||
'default' => astra_get_option( 'transparent-submenu-h-color-responsive' ),
|
||||
'type' => 'sub-control',
|
||||
'priority' => 3,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-submenu]',
|
||||
'section' => 'section-transparent-header',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'title' => __( 'Hover / Active', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Content Section Link color.
|
||||
*/
|
||||
array(
|
||||
'name' => 'transparent-content-section-link-color-responsive',
|
||||
'default' => astra_get_option( 'transparent-content-section-link-color-responsive' ),
|
||||
'type' => 'sub-control',
|
||||
'priority' => 4,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-content]',
|
||||
'section' => 'section-transparent-header',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Content Section Link Hover color.
|
||||
*/
|
||||
array(
|
||||
'name' => 'transparent-content-section-link-h-color-responsive',
|
||||
'default' => astra_get_option( 'transparent-content-section-link-h-color-responsive' ),
|
||||
'type' => 'sub-control',
|
||||
'priority' => 4,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-content]',
|
||||
'section' => 'section-transparent-header',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
),
|
||||
);
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
new Astra_Customizer_Colors_Transparent_Header_Configs();
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Index file
|
||||
*
|
||||
* @package Astra
|
||||
* @since Astra 1.0.0
|
||||
*/
|
||||
|
||||
/* Silence is golden, and we agree. */
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Index file
|
||||
*
|
||||
* @package Astra
|
||||
* @since Astra 1.0.0
|
||||
*/
|
||||
|
||||
/* Silence is golden, and we agree. */
|
||||
Reference in New Issue
Block a user