Просмотр исходного кода

Adds a 404 template (#5490)

* Adds a 404 tempalte

* add files

* Set font weight to 100

* Set search box to 100% width

* Add spacers above and below search box

Co-authored-by: Sarah Norris <sarah@sekai.co.uk>
Ben Dwyer 3 лет назад
Родитель
Сommit
4c393c1771
3 измененных файлов с 36 добавлено и 0 удалено
  1. 1 0
      archeo/inc/block-patterns.php
  2. 24 0
      archeo/inc/patterns/hidden-404.php
  3. 11 0
      archeo/templates/404.html

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

@@ -42,6 +42,7 @@ function archeo_register_block_patterns() {
 
 
 	$block_patterns = array(
 	$block_patterns = array(
 		'headline-over-dark-image',
 		'headline-over-dark-image',
+		'hidden-404',
 		'image-with-headline-on-dark-background',
 		'image-with-headline-on-dark-background',
 		'image-with-headline-description',
 		'image-with-headline-description',
 		'image-with-headline-and-description',
 		'image-with-headline-and-description',

+ 24 - 0
archeo/inc/patterns/hidden-404.php

@@ -0,0 +1,24 @@
+<?php
+/**
+ * 404 content.
+ */
+return array(
+	'title'    => __( '404 content', 'archeo' ),
+	'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.', 'archeo' ) ) . '</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?', 'archeo' ) . '</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', 'archeo' ) . '","showLabel":false,"width":100,"widthUnit":"%","buttonText":"' . esc_html__( 'Search', 'archeo' ) . '","buttonUseIcon":true,"align":"center"} /-->
+	
+	<!-- wp:spacer {"height":"2em"} -->
+	<div style="height:2em" aria-hidden="true" class="wp-block-spacer"></div>
+	<!-- /wp:spacer -->',
+);

+ 11 - 0
archeo/templates/404.html

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