Maggie Cabrera преди 4 години
родител
ревизия
5156757621
променени са 2 файла, в които са добавени 55 реда и са изтрити 0 реда
  1. 30 0
      dalston/template-parts/header/header-content.php
  2. 25 0
      dalston/template-parts/header/site-navigation.php

+ 30 - 0
dalston/template-parts/header/header-content.php

@@ -0,0 +1,30 @@
+<?php 
+
+$has_primary_nav = has_nav_menu( 'menu-1' );
+$header_classes  = 'site-header';
+$header_classes .= has_custom_logo() ? ' has-logo' : '';
+$header_classes .= 1 === get_theme_mod( 'header_text', 1 ) ? ' has-title-and-tagline' : '';
+$header_classes .= $has_primary_nav ? ' has-menu' : '';
+
+if ( ( true === get_theme_mod( 'hide_site_header', false ) && is_front_page() && is_page() ) ) : return; // Return if this is the homepage and the hide-header setting is active. ?>
+
+<?php elseif ( class_exists( 'A8C\FSE\WP_Template' ) ) : // If not, check if the FSE plugin is active, use the Header template for content. ?>
+	
+<header id="masthead" class="site-header site-branding entry-content">
+	<?php
+		$template = new A8C\FSE\WP_Template();
+		$template->output_template_content( A8C\FSE\WP_Template::HEADER );
+	?>
+</header>
+
+<?php else : // Otherwise we'll fallback to the default Varia header below. ?>
+
+<header id="masthead" class="<?php echo $header_classes; ?>" role="banner" >
+
+	<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
+	<?php get_template_part( 'template-parts/header/site', 'navigation' ); ?>
+	<?php get_template_part( 'template-parts/header/social', 'navigation' ); ?>
+
+</header><!-- #masthead -->
+
+<?php endif; ?>

+ 25 - 0
dalston/template-parts/header/site-navigation.php

@@ -0,0 +1,25 @@
+<?php 
+$has_primary_nav = has_nav_menu( 'menu-1' );
+if ( $has_primary_nav) : ?>
+	<nav id="site-navigation" class="main-navigation" aria-label="<?php esc_attr_e( 'Main Navigation', 'varia' ); ?>">
+		<input type="checkbox" role="button" aria-haspopup="true" id="toggle" class="hide-visually">
+		<label for="toggle" id="toggle-menu" class="button">
+			<?php _e( 'Menu', 'varia' ); ?>
+			<span class="dropdown-icon open">+</span>
+			<span class="dropdown-icon close">&times;</span>
+			<span class="hide-visually expanded-text"><?php _e( 'expanded', 'varia' ); ?></span>
+			<span class="hide-visually collapsed-text"><?php _e( 'collapsed', 'varia' ); ?></span>
+		</label>
+		<?php
+			$main_nav_args = array(
+			'theme_location'  => 'menu-1',
+			'menu_class'      => 'main-menu',
+			'items_wrap'      => '<ul id="%1$s" class="%2$s" aria-label="submenu">%3$s</ul>',
+		);
+		if ( get_theme_mod( 'enable_side_menu' ) === 1 ) {
+			$main_nav_args[ 'container_class' ] = 'main-menu-container';
+		}
+		wp_nav_menu( $main_nav_args );
+		?>
+	</nav><!-- #site-navigation -->
+<?php endif; ?>