Viewing File: /home/maglabs/mascotte/wp-content/themes/splendour/sidebar.php

<?php
/**
 * The Sidebar containing the main widget areas.
 *
 * @package SPLENDOUR
 * @since SPLENDOUR 1.0
 */

if ( splendour_sidebar_present() ) {
	
	$splendour_sidebar_type = splendour_get_theme_option( 'sidebar_type' );
	if ( 'custom' == $splendour_sidebar_type && ! splendour_is_layouts_available() ) {
		$splendour_sidebar_type = 'default';
	}
	
	// Catch output to the buffer
	ob_start();
	if ( 'default' == $splendour_sidebar_type ) {
		// Default sidebar with widgets
		$splendour_sidebar_name = splendour_get_theme_option( 'sidebar_widgets' );
		splendour_storage_set( 'current_sidebar', 'sidebar' );
		if ( is_active_sidebar( $splendour_sidebar_name ) ) {
			dynamic_sidebar( $splendour_sidebar_name );
		}
	} else {
		// Custom sidebar from Layouts Builder
		$splendour_sidebar_id = splendour_get_custom_sidebar_id();
		do_action( 'splendour_action_show_layout', $splendour_sidebar_id );
	}
	$splendour_out = trim( ob_get_contents() );
	ob_end_clean();
	
	// If any html is present - display it
	if ( ! empty( $splendour_out ) ) {
		$splendour_sidebar_position    = splendour_get_theme_option( 'sidebar_position' );
		$splendour_sidebar_position_ss = splendour_get_theme_option( 'sidebar_position_ss' );
		?>
		<div class="sidebar widget_area
			<?php
			echo ' ' . esc_attr( $splendour_sidebar_position );
			echo ' sidebar_' . esc_attr( $splendour_sidebar_position_ss );
			echo ' sidebar_' . esc_attr( $splendour_sidebar_type );

			$splendour_sidebar_scheme = apply_filters( 'splendour_filter_sidebar_scheme', splendour_get_theme_option( 'sidebar_scheme' ) );
			if ( ! empty( $splendour_sidebar_scheme ) && ! splendour_is_inherit( $splendour_sidebar_scheme ) && 'custom' != $splendour_sidebar_type ) {
				echo ' scheme_' . esc_attr( $splendour_sidebar_scheme );
			}
			?>
		" role="complementary">
			<?php

			// Skip link anchor to fast access to the sidebar from keyboard
			?>
			<a id="sidebar_skip_link_anchor" class="splendour_skip_link_anchor" href="#"></a>
			<?php

			do_action( 'splendour_action_before_sidebar_wrap', 'sidebar' );

			// Button to show/hide sidebar on mobile
			if ( in_array( $splendour_sidebar_position_ss, array( 'above', 'float' ) ) ) {
				$splendour_title = apply_filters( 'splendour_filter_sidebar_control_title', 'float' == $splendour_sidebar_position_ss ? esc_html__( 'Show Sidebar', 'splendour' ) : '' );
				$splendour_text  = apply_filters( 'splendour_filter_sidebar_control_text', 'above' == $splendour_sidebar_position_ss ? esc_html__( 'Show Sidebar', 'splendour' ) : '' );
				?>
				<a href="#" class="sidebar_control" title="<?php echo esc_attr( $splendour_title ); ?>"><?php echo esc_html( $splendour_text ); ?></a>
				<?php
			}
			?>
			<div class="sidebar_inner">
				<?php
				do_action( 'splendour_action_before_sidebar', 'sidebar' );
				splendour_show_layout( preg_replace( "/<\/aside>[\r\n\s]*<aside/", '</aside><aside', $splendour_out ) );
				do_action( 'splendour_action_after_sidebar', 'sidebar' );
				?>
			</div>
			<?php

			do_action( 'splendour_action_after_sidebar_wrap', 'sidebar' );

			?>
		</div>
		<div class="clearfix"></div>
		<?php
	}
}
Back to Directory File Manager