Astra_Ext_Header_Sections_Markup::below_above_header_content()

Header Sections content if Primary Menu and Custom menu items are disabled


Description


Source

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

		public function below_above_header_content() {
			$disable_primary_navigation = astra_get_option( 'disable-primary-nav' );
			$custom_header_section      = astra_get_option( 'header-main-rt-section' );
			$above_header               = $this->astra_above_header_enabled();
			$below_header               = $this->astra_below_header_enabled();

			$above_header_on_mobile = astra_get_option( 'above-header-on-mobile' );
			$below_header_on_mobile = astra_get_option( 'below-header-on-mobile' );

			if ( $disable_primary_navigation && 'none' == $custom_header_section && ( $above_header || $below_header ) && ( $above_header_on_mobile || $below_header_on_mobile ) ) {

				add_filter( 'astra_enable_mobile_menu_buttons', '__return_true' );

				$above_header_markup = $this->astra_get_above_header_items();
				$below_header_markup = $this->astra_get_below_header_items();
				?>
				<div class="main-header-bar-navigation ast-header-sections-navigation">
					<nav itemtype="https://schema.org/SiteNavigationElement" itemscope="itemscope" id="site-navigation" class="ast-flex-grow-1 navigation-accessibility" aria-label="<?php esc_attr_e( 'Site Navigation', 'astra-addon' ); ?>">
						<div class="main-navigation">
							<ul id="primary-menu" class="main-header-menu" aria-expanded="false">
								<?php do_action( 'astra_merge_header_before_menu' ); ?>

								<?php echo $above_header_markup . $below_header_markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

								<?php do_action( 'astra_merge_header_after_menu' ); ?>
							</ul>
					</div>
				<?php
			}
		}

Changelog

Changelog
Version Description
1.0.0 Introduced.


User Contributed Notes

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