Astra_Ext_Sticky_Header_Markup::fixed_header_markup()

Site Header –


Description


Source

File: addons/sticky-header/classes/class-astra-ext-sticky-header-markup.php

		public function fixed_header_markup() {

			if ( apply_filters( 'astra_fixed_header_markup_enabled', true ) ) {
				$main_stick = astra_get_option( 'header-main-stick' );

				$above_stick       = astra_get_option( 'header-above-stick' );
				$below_stick       = astra_get_option( 'header-below-stick' );
				$inherit_desk_logo = astra_get_option( 'different-sticky-logo', false );

				$sticky_header_meta         = astra_get_option_meta( 'stick-header-meta' );
				$sticky_primary_header_meta = astra_get_option_meta( 'header-main-stick-meta' );
				$sticky_above_header_meta   = astra_get_option_meta( 'header-above-stick-meta' );
				$sticky_below_header_meta   = astra_get_option_meta( 'header-below-stick-meta' );

				if ( ! (
						( '1' == $main_stick || ( 'enabled' == $sticky_header_meta && 'on' == $sticky_primary_header_meta ) ) ||
						( '1' == $above_stick || ( 'enabled' == $sticky_header_meta && 'on' == $sticky_above_header_meta ) ) ||
						( '1' == $below_stick || ( 'enabled' == $sticky_header_meta && 'on' == $sticky_below_header_meta ) )
					) ) {
					return;
				}

				$sticky_header_style   = astra_get_option( 'sticky-header-style' );
				$sticky_hide_on_scroll = astra_get_option( 'sticky-hide-on-scroll' );
				if ( 'none' == $sticky_header_style && ! $sticky_hide_on_scroll ) {
					return;
				}

				$header_logo = astra_get_option( 'sticky-header-logo' );

				if ( '1' == $inherit_desk_logo && '' != $header_logo ) {
					add_filter( 'astra_has_custom_logo', '__return_true' );
					add_filter( 'astra_disable_site_identity', '__return_true' );
					add_filter( 'astra_main_header_retina', '__return_false' );
					add_filter( 'astra_replace_logo_width', '__return_false' );
					add_filter( 'get_custom_logo', array( $this, 'sticky_custom_logo' ), 10, 2 );
				}

				?>

				<header id="ast-fixed-header" <?php astra_header_classes(); ?> style="visibility: hidden;" data-type="fixed-header">

					<?php astra_masthead_top(); ?>

					<?php astra_masthead(); ?>

					<?php astra_masthead_bottom(); ?>

				</header><!-- #astra-fixed-header -->

				<?php

				if ( '1' == $inherit_desk_logo && '' != $header_logo ) {
					remove_filter( 'astra_has_custom_logo', '__return_true' );
					remove_filter( 'astra_disable_site_identity', '__return_true' );
					remove_filter( 'astra_main_header_retina', '__return_false' );
					remove_filter( 'astra_replace_logo_width', '__return_false' );
					remove_filter( 'get_custom_logo', array( $this, 'sticky_custom_logo' ), 10 );
				}
			}
		}

Changelog

Changelog
Version Description
1.0.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.