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

Conversation

kjellr
Copy link
Contributor

@kjellr kjellr commented Jan 4, 2021

This PR tries out some new options in Varia:

  • Hide Site Header
  • Hide Site Footer (But just for the Menu... we still want the footer credit to appear.)

This could come in handy for single-page sites like those in Automattic/wp-calypso#48381.

For now I placed these checkboxes in the existing Hopepage Options area, but they could be expanded if we want them to be global (or on specific pages). It's worth noting that you can already hide most of this stuff globally if you manually remove menus from the menu locations, and also check the "Display Site Title and Tagline" option under Site Identity.

This shouldn't be merged before we test it out in all the child themes! 😉

Screenshots

Default:

Screen Shot 2021-01-04 at 2 44 39 PM

Site Header hidden:

Screen Shot 2021-01-04 at 2 44 49 PM

Site Header & Footer Menu hidden:

Screen Shot 2021-01-04 at 2 44 58 PM

@kjellr kjellr added [Type] Enhancement New feature or request [Theme] Varia labels Jan 4, 2021
@kjellr kjellr requested review from scruffian, danieldudzic, jffng and a team January 6, 2021 17:58
@kjellr
Copy link
Contributor Author

kjellr commented Jan 6, 2021

I tested this out on child themes, and it's looking pretty good:

Screen Shot 2021-01-06 at 14 31 43 Screen Shot 2021-01-06 at 14 32 42 Screen Shot 2021-01-06 at 14 33 17
Screen Shot 2021-01-06 at 14 34 21 Screen Shot 2021-01-06 at 14 35 52 Screen Shot 2021-01-06 at 14 36 34
Screen Shot 2021-01-06 at 14 39 05 Screen Shot 2021-01-06 at 14 45 52 Screen Shot 2021-01-06 at 14 40 27

In most cases, the theme just needs some padding adjustments (if anything). Hiding the header on Brompton doesn't work at all though, so that would need some extra work.

@kjellr
Copy link
Contributor Author

kjellr commented Jan 12, 2021

@scruffian: I did the initial work to get this PR working in a similar way to #2985. I do a concern with the approach though:

For Seedlet, we needed to make edits to both the child themes to get this working there. This wasn't a big deal because there was only one of them (Spearhead). It's going to be much more work to edit and test each of the 19 Varia child themes. I imagine some will be pretty straightforward, while others will need a bit of header/footer refactoring. This turns a relatively simple PR into something quite massive.

While the CSS-Only approach wasn't great in that it relied on display:none, one positive thing is that it was so simple in code + execution.

Any thoughts on how to make this easier?

@scruffian
Copy link
Member

From looking at the code for the Varia child themes headers and footer I think they could benefit from some refactoring anyway, so I think it's worth doing it to keep these themes maintainable. What do you think?

@kjellr
Copy link
Contributor Author

kjellr commented Jan 12, 2021

That sounds about right. 😄 I'll take another look tomorrow — if someone else on the team has spare time they're welcome to dig in sooner.

@kjellr kjellr removed their assignment Jan 13, 2021
@kjellr
Copy link
Contributor Author

kjellr commented Jan 13, 2021

Marking this as "To do", and removing my assignment since I don't think I'll have a chance to get to it this week.

@pbking pbking self-assigned this Jan 18, 2021
@MaggieCabrera MaggieCabrera self-assigned this Jan 19, 2021
@MaggieCabrera
Copy link
Contributor

MaggieCabrera commented Jan 19, 2021

I'm working on this now too, I added support for Alves.

Things you need to add to your footer when testing:

  • A privacy policy link
  • A footer menu needs to be defined
  • Widgets on the footer area (each theme may have them different)
  • Blog name and description defined

After we hide the footer, only the footer credit must show:

Before After
Screenshot 2021-01-19 at 12 24 36 Screenshot 2021-01-19 at 12 19 31

printf( __( 'proudly powered by %s.', 'varia' ), 'WordPress' );
?>
</a>
<?php get_template_part( 'template-parts/footer/privacy-policy', '' ); ?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this is a change - previously the privacy policy was inside the wordpress.org link, but I assume that is a bug.

@MaggieCabrera MaggieCabrera requested a review from a team January 19, 2021 17:45
varia/header.php Outdated
</header><!-- #masthead -->

<?php endif; ?>
<?php get_template_part( 'template-parts/header/header', 'content' ); ?>
Copy link
Member

@scruffian scruffian Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this code here:

<?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. ?>

Then we don't need to repeat it in every template part.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I believe for the header we will be able to do that, I will go ahead with that, thx

@scruffian
Copy link
Member

For Brompton the footer is still quite obtrusive:

Screenshot 2021-01-20 at 10 27 07

I wonder if we should scale it down if the footer is hidden?

@MaggieCabrera
Copy link
Contributor

For Brompton the footer is still quite obtrusive:

Screenshot 2021-01-20 at 10 27 07

I wonder if we should scale it down if the footer is hidden?

Thought so too. Maybe remove the background and keep the text black when the footer is hidden? This will affect color annotations by the way :D Maybe design input for this? @kjellr

@scruffian
Copy link
Member

Thought so too. Maybe remove the background and keep the text black when the footer is hidden? This will affect color annotations by the way :D Maybe design input for this?

Probably this makes sense in a followup PR anyway. And maybe only if we get that feedback...

@scruffian scruffian merged commit 41bcf70 into trunk Jan 20, 2021
@scruffian scruffian deleted the try/varia-header-footer-hide branch January 20, 2021 12:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants