Procházet zdrojové kódy

header for Coutoire

Maggie Cabrera před 4 roky
rodič
revize
a458920d9b

+ 0 - 63
coutoire/header.php

@@ -1,63 +0,0 @@
-<?php
-/**
- * The header for our theme
- *
- * This is the template that displays all of the <head> section and everything up until <div id="content">
- *
- * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
- *
- * @package WordPress
- * @subpackage Varia
- * @since 1.0.0
- */
-?><!doctype html>
-<html <?php language_attributes(); ?>>
-<head>
-	<meta charset="<?php bloginfo( 'charset' ); ?>" />
-	<meta name="viewport" content="width=device-width, initial-scale=1" />
-	<link rel="profile" href="https://gmpg.org/xfn/11" />
-	<?php wp_head(); ?>
-</head>
-
-<body <?php body_class(); ?>>
-
-<?php
-	if ( function_exists( 'wp_body_open' ) ) {
-		wp_body_open();
-	}
-?>
-	
-<div id="page" class="site">
-	<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'varia' ); ?></a>
-
-		<header id="masthead" class="site-header alignfull">
-
-			<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
-
-			<?php if ( has_nav_menu( 'menu-1' ) ) : ?>
-				<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
-					wp_nav_menu(
-						array(
-							'theme_location' => 'menu-1',
-							'menu_class'     => 'main-menu',
-							'items_wrap'     => '<ul id="%1$s" class="%2$s" aria-label="submenu">%3$s</ul>',
-						)
-					);
-					?>
-				</nav><!-- #site-navigation -->
-			<?php endif; ?>
-
-			<?php get_template_part( 'template-parts/header/social', 'navigation' ); ?>
-
-		</header><!-- #masthead -->
-
-	<div id="content" class="site-content">

+ 3 - 0
coutoire/sass/_extra-child-theme.scss

@@ -311,6 +311,9 @@ a.wp-block-file__button {
 		margin-top: #{10 * $spacing_horizontal};
 		position: relative;
 		z-index: 2;
+		.hide-homepage-header & {
+			margin-top: 0;
+		}
 	}
 
 	.nav-links {

+ 15 - 0
coutoire/style-rtl.css

@@ -3167,6 +3167,18 @@ body:not(.fse-enabled) .footer-menu a {
 	overflow: scroll;
 }
 
+.home.page.hide-homepage-header.hide-homepage-title .entry-content {
+	margin-top: 0;
+	padding-top: 0;
+}
+
+.home.page.hide-homepage-header.hide-homepage-title .entry-content > .wp-block-image.alignfull:first-child,
+.home.page.hide-homepage-header.hide-homepage-title .entry-content > .wp-block-cover.alignfull:first-child,
+.home.page.hide-homepage-header.hide-homepage-title .entry-content > .wp-block-media-text.alignfull:first-child,
+.home.page.hide-homepage-header.hide-homepage-title .entry-content > .wp-block-group.has-background.alignfull:first-child {
+	margin-top: -32px;
+}
+
 .entry-attachment {
 	text-align: center;
 }
@@ -4275,6 +4287,9 @@ a.wp-block-file__button {
 		position: relative;
 		z-index: 2;
 	}
+	.hide-homepage-header .content-area {
+		margin-top: 0;
+	}
 	.nav-links {
 		display: block;
 	}

+ 15 - 0
coutoire/style.css

@@ -3186,6 +3186,18 @@ body:not(.fse-enabled) .footer-menu a {
 	overflow: scroll;
 }
 
+.home.page.hide-homepage-header.hide-homepage-title .entry-content {
+	margin-top: 0;
+	padding-top: 0;
+}
+
+.home.page.hide-homepage-header.hide-homepage-title .entry-content > .wp-block-image.alignfull:first-child,
+.home.page.hide-homepage-header.hide-homepage-title .entry-content > .wp-block-cover.alignfull:first-child,
+.home.page.hide-homepage-header.hide-homepage-title .entry-content > .wp-block-media-text.alignfull:first-child,
+.home.page.hide-homepage-header.hide-homepage-title .entry-content > .wp-block-group.has-background.alignfull:first-child {
+	margin-top: -32px;
+}
+
 .entry-attachment {
 	text-align: center;
 }
@@ -4304,6 +4316,9 @@ a.wp-block-file__button {
 		position: relative;
 		z-index: 2;
 	}
+	.hide-homepage-header .content-area {
+		margin-top: 0;
+	}
 	.nav-links {
 		display: block;
 	}

+ 45 - 0
coutoire/template-parts/header/header-content.php

@@ -0,0 +1,45 @@
+<?php 
+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="fse-template-part fse-header 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="site-header alignfull">
+
+	<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
+
+	<?php if ( has_nav_menu( 'menu-1' ) ) : ?>
+		<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
+			wp_nav_menu(
+				array(
+					'theme_location' => 'menu-1',
+					'menu_class'     => 'main-menu',
+					'items_wrap'     => '<ul id="%1$s" class="%2$s" aria-label="submenu">%3$s</ul>',
+				)
+			);
+			?>
+		</nav><!-- #site-navigation -->
+	<?php endif; ?>
+
+	<?php get_template_part( 'template-parts/header/social', 'navigation' ); ?>
+
+</header><!-- #masthead -->
+
+<?php endif; ?>