-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path404.php
135 lines (121 loc) · 4.49 KB
/
404.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
/**
* The template for displaying 404 pages (not found)
*
* @package uds-wordpress-theme
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
// Get theme mods from the Customizer.
$image_404 = get_theme_mod( 'image_404' );
$page_type = get_theme_mod( '404_page_type' );
$custom_page_name = get_the_title( get_theme_mod( '404_page_id' ) );
get_header();
?>
<main id="skip-to-content" <?php post_class(); ?>>
<?php
// if we have chosen a custom page type.
if ( 'custom' === $page_type ) {
// get the 404 page name from the customizer.
$not_found_page = get_page_by_title( $custom_page_name );
// get the blocks for the 404 page.
$blocks = parse_blocks( $not_found_page->post_content );
// create a var for the markup.
$content = '';
// loop through block.
foreach ( $blocks as $block ) {
// render this block into the content.
$content .= render_block( $block );
}
// output the 404 page content - the blocks!
echo $content;
} else {
// If we have chosen 'default' from the customizer.
if ($image_404) {
?>
<div class="v1-uds-hero uds-hero-md hero-image">
<?php $image_404 = wp_kses( $image_404, wp_kses_allowed_html( 'post' ) ); ?>
<img src="<?php echo $image_404; ?>" alt="404 - Not Found" />
<div class="container v1-uds-hero-container">
<div class="container px-0 error-404 not-found">
<div class="row">
<div class="col col-lg-8">
<h1 class="col-md-12 px-0">
<span class="highlight-gold">
<?php esc_html_e( '404 - Not Found', 'uds-wordpress-theme' ); ?>
</span>
</h1>
</div>
</div>
<div class="row">
<div class="col col-lg-8 ">
<h4>
<span class="highlight-white">
<?php esc_html_e( 'It looks like nothing was found! Maybe try a search?', 'uds-wordpress-theme' ); ?>
</span>
</h4>
<form action="https://search.asu.edu/search" class="form-inline navbar-mobile-search" method="get" name="gs" mptid="2">
<input aria-label="header-mid-search" class="form-control" name="q" placeholder="Search asu.edu" type="search" mptid="INPUT;name:gs;0">
<input name="url_host" type="hidden" value="
<?php
$search_site_url = site_url();
$search_site_url = preg_replace('#^https?://#i', '', $search_site_url);
echo $search_site_url;
?>">
<input name="site" type="hidden" value="default_collection">
<input name="sort" type="hidden" value="date:D:L:d1">
<input name="output" type="hidden" value="xml_no_dtd">
<input name="ie" type="hidden" value="UTF-8">
<input name="oe" type="hidden" value="UTF-8">
<input name="client" type="hidden" value="asu_frontend">
<input name="proxystylesheet" type="hidden" value="asu_frontend">
</form>
</div><!-- .page-content -->
</div>
</div>
</div>
</div>
<?php
} else {
?>
<div class="bg network-white pb-5 pt-5">
<div class="container">
<div class="row">
<div class="col col-lg-8">
<h1 class="heading heading-one col-md-12">
<span class="highlight highlight-gold highlight-heading-one">
<?php esc_html_e( '404 - Not Found', 'uds-wordpress-theme' ); ?>
</span>
</h1>
</div>
</div>
<div class="row">
<div class="col col-lg-8 ">
<h4><?php esc_html_e( 'It looks like nothing was found! Maybe try a search?', 'uds-wordpress-theme' ); ?></h4>
<form action="https://search.asu.edu/search" class="form-inline navbar-mobile-search" method="get" name="gs" mptid="2">
<input aria-label="header-mid-search" class="form-control" name="q" placeholder="Search asu.edu" type="search" mptid="INPUT;name:gs;0">
<input name="url_host" type="hidden" value="
<?php
$search_site_url = site_url();
$search_site_url = preg_replace('#^https?://#i', '', $search_site_url);
echo $search_site_url;
?>">
<input name="site" type="hidden" value="default_collection">
<input name="sort" type="hidden" value="date:D:L:d1">
<input name="output" type="hidden" value="xml_no_dtd">
<input name="ie" type="hidden" value="UTF-8">
<input name="oe" type="hidden" value="UTF-8">
<input name="client" type="hidden" value="asu_frontend">
<input name="proxystylesheet" type="hidden" value="asu_frontend">
</form>
</div><!-- .page-content -->
</div>
</div>
</div>
<?php
}
}
?>
</main>
<?php
get_footer();