-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path404.php
39 lines (36 loc) · 1.31 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
<?php
/**
* The template for displaying 404 pages (not found).
*
* @link https://codex.wordpress.org/Creating_an_Error_404_Page
*
* @package RedRock
*/
get_header();
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<section class="error-404 not-found">
<header class="page-header">
<h1 class="page-title">That page cannot be found.</h1>
</header>
<div class="page-content">
<p>The page you want has moved or does not exist. You might find what you want if you do a search.</p>
<?php
if (isset($_GET["id"])) {
$searchPrefill = $_GET["id"];
}
else {
$searchPrefill = basename(strtok($_SERVER["REQUEST_URI"], "?"));
}
$searchPrefill = preg_replace('/^\d+-/', '', $searchPrefill);
$searchPrefill = preg_replace('/^article-/', '', $searchPrefill);
$searchPrefill = preg_replace('/[^a-zA-Z0-9]+/', ' ', $searchPrefill);
$searchPrefill = trim($searchPrefill);
include(locate_template('searchform.php', false, false));
?>
</div>
</section>
</main>
</div>
<?php get_footer(); ?>