Browse Source

footer dalston, margin top header too

Maggie Cabrera 4 years ago
parent
commit
f5897b420e

+ 0 - 83
dalston/header.php

@@ -1,83 +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
- */
-$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' : '';
-?><!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>
-
-	<?php if ( class_exists( 'A8C\FSE\WP_Template' ) ) : // 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 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; ?>
-
-			<?php get_template_part( 'template-parts/header/social', 'navigation' ); ?>
-
-		</header><!-- #masthead -->
-
-	<?php endif; ?>
-
-	<div id="content" class="site-content">

+ 6 - 0
dalston/sass/_extra-child-theme.scss

@@ -216,11 +216,17 @@ a {
 .site-main > article > .entry-header {
 	margin: #{3 * $spacing_unit} 0 $spacing_unit;
 	position: relative;
+	.hide-homepage-header & {
+		margin: $spacing_unit 0 $spacing_unit;		
+	}
 }
 
 @include media(mobile) {
 	.site-main > article > .entry-header {
 		margin: #{3 * $spacing_vertical} auto #{2 * $spacing_unit};
+		.hide-homepage-header & {
+			margin: #{2 * $spacing_unit} auto #{2 * $spacing_unit};			
+		}
 	}
 }
 

+ 19 - 0
dalston/style-rtl.css

@@ -3169,6 +3169,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;
 }
@@ -4176,10 +4188,17 @@ a {
 	position: relative;
 }
 
+.hide-homepage-header .site-main > article > .entry-header {
+	margin: 16px 0 16px;
+}
+
 @media only screen and (min-width: 560px) {
 	.site-main > article > .entry-header {
 		margin: 96px auto 32px;
 	}
+	.hide-homepage-header .site-main > article > .entry-header {
+		margin: 32px auto 32px;
+	}
 }
 
 .site-main .page-header {

+ 19 - 0
dalston/style.css

@@ -3188,6 +3188,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;
 }
@@ -4205,10 +4217,17 @@ a {
 	position: relative;
 }
 
+.hide-homepage-header .site-main > article > .entry-header {
+	margin: 16px 0 16px;
+}
+
 @media only screen and (min-width: 560px) {
 	.site-main > article > .entry-header {
 		margin: 96px auto 32px;
 	}
+	.hide-homepage-header .site-main > article > .entry-header {
+		margin: 32px auto 32px;
+	}
 }
 
 .site-main .page-header {

+ 16 - 26
dalston/template-parts/footer/footer-content.php

@@ -1,31 +1,21 @@
-<footer id="colophon" class="site-footer <?php echo class_exists( 'A8C\FSE\WP_Template' ) ? 'entry-content' : 'responsive-max-width'; ?>">
+<?php if ( class_exists( 'A8C\FSE\WP_Template' ) ) : // If the FSE plugin is active, use the Header template for content. ?>
+	<footer class="fse-template-part fse-footer entry-content">
 	<?php
-	if ( class_exists( 'A8C\FSE\WP_Template' ) ) : // If the FSE plugin is active, use the Header template for content.
 		$template = new A8C\FSE\WP_Template();
 		$template->output_template_content( A8C\FSE\WP_Template::FOOTER );
-		else : // Otherwise we'll fallback to the default Varia footer below.
-			get_template_part( 'template-parts/footer/footer', 'widgets' );
-
-			if ( has_nav_menu( 'menu-2' ) ) :
-				?>
-				<nav class="footer-navigation" aria-label="<?php esc_attr_e( 'Footer Menu', 'varia' ); ?>">
-					<?php
-					wp_nav_menu(
-						array(
-							'theme_location' => 'menu-2',
-							'menu_class'     => 'footer-menu',
-							'depth'          => 1,
-						)
-					);
-					?>
-				</nav><!-- .footer-navigation -->
-				<?php
-			endif;
-		endif;
+	else : // Otherwise we'll fallback to the default Varia footer below.
 		?>
 
-	<div class="site-info">
-		<?php get_template_part( 'template-parts/footer/site-name', '' ); ?>
-		<?php get_template_part( 'template-parts/footer/privacy-policy', '' ); ?>
-	</div><!-- .site-info -->
-</footer><!-- #colophon -->
+	<footer id="colophon" class="site-footer responsive-max-width">
+			<?php
+			if ( ! ( true === get_theme_mod( 'hide_site_footer', false ) && is_front_page() && is_page() ) ) : // If this is the homepage and the footer elements are set to hide, don't load this part.
+				get_template_part( 'template-parts/footer/footer', 'widgets' );
+				get_template_part( 'template-parts/footer/footer', 'navigation' );
+			endif;
+			?>
+	<?php endif; ?>
+		<div class="site-info">
+			<?php get_template_part( 'template-parts/footer/site-name', '' ); ?>
+			<?php get_template_part( 'template-parts/footer/privacy-policy', '' ); ?>
+		</div><!-- .site-info -->
+	</footer><!-- #colophon -->