Skip to content

Instantly share code, notes, and snippets.

@westonruter
Created August 5, 2020 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save westonruter/8a7d83bf33d38cc39b0832361c06c91f to your computer and use it in GitHub Desktop.
Save westonruter/8a7d83bf33d38cc39b0832361c06c91f to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Try Node No Longer Exists
* Description: To test, ensure that all templates as served as AMP and then access what would be an AMP page with "?try_node_no_longer_exists_warning=1".
*/
add_action( 'template_redirect', function () {
if ( ! isset( $_GET['try_node_no_longer_exists_warning'] ) ) {
return;
}
?>
<html amp="" lang="en">
<head>
<meta charSet="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<style amp-custom="">
amp-story-grid-layer {
overflow: visible;
}
</style>
<title>Story of Bison</title>
<?php wp_head(); ?>
</head>
<body>
<amp-story publisher="WordPress Develop2wwss" publisher-logo-src="https://wordpressdev.lndo.site/content/plugins/web-stories/assets/images/fallback-wordpress-publisher-logo.png" title="Story of Bison" poster-portrait-src="https://wordpressdev.lndo.site/content/uploads/2020/07/American_bison_k5680-1-300x196.jpg">
<amp-story-page id="a4ddcc59-91f2-4da2-8251-bdd86dc99523">
<amp-story-grid-layer template="vertical" aspect-ratio="412:618">
<div class="page-fullbleed-area" style="background-color:#fff"></div>
</amp-story-grid-layer>
</amp-story-page>
</amp-story>
<?php wp_footer(); ?>
</body>
</html>
<?php
exit;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment