-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Theme Templates: Add Twenty Twenty specific template for offline views
Twenty Twenty uses a much different markup format for pages, so it's easier to match by using an entirely separate template. This approach should be considered a "patch", if the PWA merges into core, default themes will provide these templates.
- Loading branch information
Showing
2 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
public_html/wp-content/mu-plugins/theme-templates/templates/offline-2020.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* Template Name: Offline Notice | ||
* | ||
* This is the Twenty Twenty-specific offline template, which will be used for offline views of a PWA-enabled site. | ||
* See `./offline.php` for more information. | ||
*/ | ||
|
||
namespace WordCamp\Theme_Templates; | ||
|
||
get_header(); | ||
|
||
$offline_page = get_offline_content(); | ||
?> | ||
|
||
<main id="site-content" role="main"> | ||
|
||
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>"> | ||
|
||
<header class="entry-header has-text-align-center"> | ||
|
||
<div class="entry-header-inner section-inner medium"> | ||
|
||
<h1 class="entry-title"><?php echo wp_kses_post( $offline_page['title'] ); ?></h1> | ||
|
||
</div><!-- .entry-header-inner --> | ||
|
||
</header><!-- .entry-header --> | ||
|
||
<div class="post-inner"> | ||
|
||
<div class="entry-content"> | ||
|
||
<?php echo wp_kses_post( $offline_page['content'] ); ?> | ||
|
||
</div><!-- .entry-content --> | ||
|
||
</div><!-- .post-inner --> | ||
|
||
</article><!-- .post --> | ||
|
||
</main><!-- #site-content --> | ||
|
||
<?php get_template_part( 'template-parts/footer-menus-widgets' ); ?> | ||
|
||
<?php get_footer(); ?> |