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;
|
||||
}
|
||||
Reference in New Issue
Block a user