Skip to content

Commit

Permalink
Improvements to PWA template: remove menus, widgets and WordAds; add …
Browse files Browse the repository at this point in the history
…minimum height for content area.
  • Loading branch information
laurelfulford committed Oct 22, 2019
1 parent f92f9c1 commit 48f8181
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@

<?php
// If logo is not centered.
if ( false === $header_center_logo ) {
if ( false === $header_center_logo && has_nav_menu( 'primary-menu' ) ) {
get_template_part( 'template-parts/header/header', 'search' );
}
?>
Expand Down
10 changes: 10 additions & 0 deletions offline.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
* @package Newspack
*/

// Prevent showing nav menus.
add_filter( 'has_nav_menu', '__return_false' );

// Prevent showing widgets.
add_filter( 'is_active_sidebar', '__return_false' );

// Disable WordAds in the header.
// See: https://wordads.co/2018/02/07/how-to-control-jetpack-ad-placements-using-hooks/
add_filter( 'wordads_header_disable', '__return_true' );

get_header();
?>
<section id="primary" class="content-area">
Expand Down
1 change: 1 addition & 0 deletions sass/layout/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
}

.site-content {
min-height: 30vh;
overflow: hidden;
}

Expand Down

0 comments on commit 48f8181

Please sign in to comment.