Skip to content
This repository has been archived by the owner on Feb 17, 2025. It is now read-only.

Try: Add hide site header/footer Customizer options to Varia #2961

Merged
merged 37 commits into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c6ff72a
Try: Add hide site header/footer Customizer options to Varia.
kjellr Jan 4, 2021
bfeedb6
Hide the footer widget area too.
kjellr Jan 6, 2021
7d979a0
Fix incorrect setting name.
kjellr Jan 6, 2021
6bee1f4
Fix another variable name.
kjellr Jan 6, 2021
cb5315e
Remove top margin and padding from entry content by default.
kjellr Jan 6, 2021
722be47
Merge branch 'trunk' into try/varia-header-footer-hide
kjellr Jan 12, 2021
007f935
Begin refactor to more closely match #2985
kjellr Jan 12, 2021
fd4c213
Tidy up into partials.
kjellr Jan 12, 2021
2e52a5e
footer info template part and Alves footer fix
MaggieCabrera Jan 19, 2021
4662cf6
refactor footer templates to make it easier to share code
scruffian Jan 19, 2021
2fd4a1f
Create a template for privacy policy
scruffian Jan 19, 2021
b43950c
replace site name code with a template
scruffian Jan 19, 2021
ffcae3f
move the WordPress credit into the site name template
scruffian Jan 19, 2021
4229d46
social navigation template part
MaggieCabrera Jan 19, 2021
00ed303
stratford social nav
MaggieCabrera Jan 19, 2021
bbbac69
header for Balasana
MaggieCabrera Jan 19, 2021
a15f25b
footer for Brompton
MaggieCabrera Jan 19, 2021
a458920
header for Coutoire
MaggieCabrera Jan 19, 2021
5156757
header Dalston
MaggieCabrera Jan 19, 2021
f5897b4
footer dalston, margin top header too
MaggieCabrera Jan 19, 2021
eec55a5
fix spacing
scruffian Jan 19, 2021
1f1d687
fix spacing
scruffian Jan 19, 2021
b35115c
header Morden
MaggieCabrera Jan 19, 2021
217cd6e
another small refactor
scruffian Jan 19, 2021
195bf6e
Merge branch 'try/varia-header-footer-hide' of github.com:Automattic/…
MaggieCabrera Jan 19, 2021
45286ee
Merge branch 'try/varia-header-footer-hide' of github.com:Automattic/…
scruffian Jan 19, 2021
cff4974
rockfield header and footer
MaggieCabrera Jan 19, 2021
07ab78f
Stow header
MaggieCabrera Jan 19, 2021
a436457
Merge branch 'try/varia-header-footer-hide' of github.com:Automattic/…
MaggieCabrera Jan 19, 2021
5227731
small refactor, rivington header and footer
MaggieCabrera Jan 19, 2021
6e1a598
Stratford header and footer
MaggieCabrera Jan 19, 2021
1e4cb5f
refactor FSE header templates
scruffian Jan 20, 2021
4a0a3ff
refactor FSE header templates
scruffian Jan 20, 2021
7f79b14
remove unconnected change
scruffian Jan 20, 2021
2260fd2
refactored site-navigation
MaggieCabrera Jan 20, 2021
65829ef
Merge branch 'try/varia-header-footer-hide' of github.com:Automattic/…
MaggieCabrera Jan 20, 2021
fce321c
fix spacing issues
scruffian Jan 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions balasana/template-parts/header/header-content.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
<?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="site-header responsive-max-width">
<?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 Balasana header below. ?>

<header id="masthead" class="site-header responsive-max-width">
<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
<?php get_template_part( 'template-parts/header/site', 'navigation' ); ?>
</header><!-- #masthead -->

<?php endif; ?>
<header id="masthead" class="site-header responsive-max-width">
<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
<?php get_template_part( 'template-parts/header/site', 'navigation' ); ?>
</header><!-- #masthead -->
16 changes: 0 additions & 16 deletions coutoire/template-parts/header/header-content.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
<?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' ); ?>
Expand Down Expand Up @@ -41,5 +27,3 @@
<?php get_template_part( 'template-parts/header/social', 'navigation' ); ?>

</header><!-- #masthead -->

<?php endif; ?>
21 changes: 2 additions & 19 deletions dalston/template-parts/header/header-content.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
<?php

<?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; ?>
35 changes: 10 additions & 25 deletions morden/template-parts/header/header-content.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
<?php
<?php
$has_primary_nav = has_nav_menu( 'menu-1' );
$header_classes = 'site-header-wrap responsive-max-width';
$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="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" role="banner">
<div class="<?php echo $header_classes; ?>">
<?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' ); ?>
</div><!-- .site-header-wrap -->

</header><!-- #masthead -->

<?php endif; ?>
?>

<header id="masthead" class="site-header" role="banner">
<div class="<?php echo $header_classes; ?>">
<?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' ); ?>
</div><!-- .site-header-wrap -->
</header><!-- #masthead -->
27 changes: 6 additions & 21 deletions rivington/template-parts/header/header-content.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
<?php

<?php
$has_primary_nav = has_nav_menu( 'menu-1' );
$header_classes = 'site-header responsive-max-width';
$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="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="<?php echo $header_classes; ?>" role="banner">
<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
<?php get_template_part( 'template-parts/header/site', 'navigation' ); ?>
</header><!-- #masthead -->

<?php endif; ?>
<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' ); ?>
</header><!-- #masthead -->
24 changes: 4 additions & 20 deletions rockfield/template-parts/header/header-content.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
<?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">
<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
<?php get_template_part( 'template-parts/header/site', 'navigation' ); ?>
</header><!-- #masthead -->

<?php endif; ?>
<header id="masthead" class="site-header">
<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
<?php get_template_part( 'template-parts/header/site', 'navigation' ); ?>
</header><!-- #masthead -->
3 changes: 2 additions & 1 deletion spearhead/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

--entry-header--font-size: var(--heading--font-size-h1);
--entry-header--color: var(--global--color-foreground);
--entry-header--color-link: var(--entry-header--color);

--button--border-radius: 0px;
--button--color-text: var(--global--color-background);
Expand Down Expand Up @@ -102,7 +103,7 @@
}

@media ( prefers-color-scheme: dark ) {
:root {
:root :not(.custom-colors) {
--global--color-primary: #ff6a81;
--global--color-primary-hover: #ffffff;
--global--color-secondary: #b2b2b2;
Expand Down
25 changes: 4 additions & 21 deletions stow/template-parts/header/header-content.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
<?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">
<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
<?php get_template_part( 'template-parts/header/site', 'navigation' ); ?>
</header><!-- #masthead -->

<?php endif; ?>
<header id="masthead" class="site-header">
<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
<?php get_template_part( 'template-parts/header/site', 'navigation' ); ?>
</header><!-- #masthead -->
28 changes: 6 additions & 22 deletions stratford/template-parts/header/header-content.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
<?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. ?>
<header id="masthead" class="site-header alignfull">

<?php elseif ( class_exists( 'A8C\FSE\WP_Template' ) ) : // If not, check if the FSE plugin is active, use the Header template for content. ?>
<div class="site-header-wrapper">

<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 get_template_part( 'template-parts/header/site', 'branding' ); ?>
<?php get_template_part( 'template-parts/header/site', 'navigation' ); ?>

<?php else : // Otherwise we'll fallback to the default Varia header below. ?>
</div>

<header id="masthead" class="site-header alignfull">

<div class="site-header-wrapper">

<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
<?php get_template_part( 'template-parts/header/site', 'navigation' ); ?>

</div>

</header><!-- #masthead -->

<?php endif; ?>
</header><!-- #masthead -->
10 changes: 9 additions & 1 deletion varia/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
<div id="page" class="site">
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'varia' ); ?></a>

<?php get_template_part( 'template-parts/header/header', 'content' ); ?>
<?php
if ( ( true === get_theme_mod( 'hide_site_header', false ) && is_front_page() && is_page() ) ) {
// Do nothing if this is the homepage and the hide-header setting is active.
} elseif ( class_exists( 'A8C\FSE\WP_Template' ) ) { // If not, check if the FSE plugin is active, use the Header template for content.
get_template_part( 'template-parts/header/fse', 'header' );
} else { // Otherwise we'll fallback to the default Varia header below.
get_template_part( 'template-parts/header/header', 'content' );
}
?>

<div id="content" class="site-content">
39 changes: 12 additions & 27 deletions varia/template-parts/header/header-content.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
<?php

$has_primary_nav = has_nav_menu( 'menu-1' );
$header_classes = 'site-header responsive-max-width';
$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="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="<?php echo $header_classes; ?>" role="banner">
<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
<?php get_template_part( 'template-parts/header/site', 'navigation' ); ?>
</header><!-- #masthead -->

<?php endif; ?>
<?php
$has_primary_nav = has_nav_menu( 'menu-1' );
$header_classes = 'site-header responsive-max-width';
$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' : '';
?>

<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' ); ?>
</header><!-- #masthead -->