Repository navigation
Expand file tree
/
Copy path404.php
More file actions
59 lines (47 loc) · 1.54 KB
/
Copy path404.php
File metadata and controls
59 lines (47 loc) · 1.54 KB
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
<?php
/**
* The template for displaying 404 pages (not found)
*
* @package Luminary
* @since 1.0.0
*/
get_header();
?>
<div class="site-content-area container">
<div class="content-sidebar-wrap">
<main id="primary" class="site-main">
<section class="error-404 not-found">
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( '404', 'luminary' ); ?></h1>
<p class="error-404__subtitle"><?php esc_html_e( 'Page Not Found', 'luminary' ); ?></p>
</header><!-- .page-header -->
<div class="page-content">
<p><?php esc_html_e( 'It looks like nothing was found at this location. Maybe try a search?', 'luminary' ); ?></p>
<?php get_search_form(); ?>
<?php
$recent_posts = new WP_Query(
array(
'posts_per_page' => 5,
'no_found_rows' => true,
'ignore_sticky_posts' => true,
)
);
if ( $recent_posts->have_posts() ) :
?>
<h2 class="error-404__section-title"><?php esc_html_e( 'Recent Posts', 'luminary' ); ?></h2>
<ul class="error-404__recent-posts">
<?php while ( $recent_posts->have_posts() ) : $recent_posts->the_post(); ?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php endwhile; ?>
</ul>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
</div><!-- .page-content -->
</section><!-- .error-404 -->
</main><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .content-sidebar-wrap -->
</div><!-- .container -->
<?php get_footer(); ?>