Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWA: Add 'offline.php' template #523

Merged
merged 5 commits into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
35 changes: 35 additions & 0 deletions offline.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* The PWA Offline template file
*
* @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">
<header class="entry-header">
<h1 class="entry-title"><?php esc_html_e( 'Offline', 'newspack' ); ?></h1>
</header><!-- .entry-header -->
<main id="main" class="site-main">
<?php
if ( function_exists( 'wp_service_worker_error_message_placeholder' ) ) {
wp_service_worker_error_message_placeholder();
}
?>
</main><!-- .site-main -->
</section><!-- .content-area -->
<?php
get_footer();


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