Explorar el Código

Remote: Adding 404 page template (#5542)

* Remote: Adding hidden 404 page template
Co-authored-by: Jason Crist <jcrist@pbking.com>
Matias Benedetto hace 3 años
padre
commit
31299d088a

+ 1 - 0
remote/inc/block-patterns.php

@@ -44,6 +44,7 @@ function remote_register_block_patterns() {
 		'hero-text',
 		'posts-list',
 		'hidden-search-form',
+		'hidden-404-content',
 	);
 
 	/**

+ 24 - 0
remote/inc/patterns/hidden-404-content.php

@@ -0,0 +1,24 @@
+<?php
+/**
+ * 404 content.
+ */
+return array(
+	'title'    => __( '404 content', 'remote' ),
+	'inserter' => false,
+	'content'  => '<!-- wp:heading {"style":{"typography":{"fontSize":"clamp(4rem, 40vw, 20rem)","fontWeight":"100","lineHeight":"1"}},"className":"has-text-align-center"} -->
+	<h2 class="has-text-align-center" style="font-size:clamp(4rem, 40vw, 20rem);font-weight:100;line-height:1">' . esc_html( _x( '404', 'Error code for a webpage that is not found.', 'remote' ) ) . '</h2>
+	<!-- /wp:heading -->
+	<!-- wp:paragraph {"align":"center"} -->
+	<p class="has-text-align-center">' . esc_html__( 'This page could not be found. Maybe try a search?', 'remote' ) . '</p>
+	<!-- /wp:paragraph -->
+
+	<!-- wp:spacer {"height":"1em"} -->
+	<div style="height:1em" aria-hidden="true" class="wp-block-spacer"></div>
+	<!-- /wp:spacer -->
+
+	<!-- wp:search {"label":"' . esc_html__( 'Search', 'remote' ) . '","showLabel":false,"width":100,"widthUnit":"%","buttonText":"' . esc_html__( 'Search', 'remote' ) . '","buttonUseIcon":true,"align":"center"} /-->
+	
+	<!-- wp:spacer {"height":"2em"} -->
+	<div style="height:2em" aria-hidden="true" class="wp-block-spacer"></div>
+	<!-- /wp:spacer -->',
+);

+ 9 - 0
remote/templates/404.html

@@ -0,0 +1,9 @@
+<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
+
+<!-- wp:group {"tagName":"main", "layout":{"inherit":true}} -->
+<main class="wp-block-group">
+<!-- wp:pattern {"slug":"remote/hidden-404-content"} /-->
+</main>
+<!-- /wp:group -->
+
+<!-- wp:template-part {"slug":"footer","tagName":"footer","layout":{"inherit":true}} /-->