-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path404.php
52 lines (46 loc) · 2.25 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
<?php
$json = file_get_contents('https://opentdb.com/api.php?amount=1');
$trivia = json_decode($json)->results[0];
$possible_answers = $trivia->incorrect_answers;
$possible_answers[] = $trivia->correct_answer;
if (sizeof($possible_answers) > 2) {
sort($possible_answers, SORT_STRING);
}
get_header(); ?>
<div class="container">
<div class="row">
<div class="col-lg-8 blog-main">
<h1><?php _e( 'The page you requested cannot be found', 'chester' ); ?></h1>
<p class="lead">The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. You may also not be authorised to view the page.</p>
<hr>
<!-- Trivia Section Woo -->
<aside class="cell">
<h2 class="h4 mb-0">Trivia</h2>
<p class="small text-muted mb-2"><?=$trivia->category?></p>
<p class="mb-0"><span class="mono">Q: </span><strong><?=$trivia->question?></strong></p>
<? if (sizeof($possible_answers) > 2) { ?>
<ol class="list-unstyled">
<? for ($i = 0; $i < sizeof($possible_answers); $i++) { ?>
<li><span class="mono"> </span><?=$possible_answers[$i]?></li>
<? } ?>
</ol>
<? } ?>
<p class="mb-0"><span class="mono">A: </span><em><?=$trivia->correct_answer?></em></p>
</aside>
<!-- Trivia API by opentdb.com -->
<hr>
<p>Please try the following:</p>
<ul>
<li>Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.</li>
<li>If you reached this page by clicking a link, contact the Web site administrator to alert them that the link is incorrectly formatted.</li>
<li>Click the <a href="javascript:history.back(1)">Back</a> button to try another link.</li>
</ul>
<p>HTTP Error 404 - File or directory not found.</p>
<hr>
<h2>Try searching for what you're looking for instead</h2>
<?php get_search_form(); ?>
<p class="mt-2">Contact our <a href="mailto:[email protected]" title="Support Hotline">support address</a> if the issue persists.</p>
</div><!-- /.blog-main -->
</div>
</div>
<?php get_footer(); ?>