forked from FameThemes/codilight-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
404.php
92 lines (84 loc) · 3.38 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
<?php
/**
* The template for displaying 404 pages (not found).
*
* @link https://codex.wordpress.org/Creating_an_Error_404_Page
*
* @package Codilight_Lite
*/
get_header(); ?>
<div id="content" class="site-content container no-sidebar">
<div class="content-inside">
<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"><?php esc_html_e( 'Ooops… Error 404', 'codilight-lite' ); ?></h1>
<h3 class="page-subtitle"><?php esc_html_e( 'Sorry, but the page you are looking for doesn’t exist. ', 'codilight-lite' ); ?></h3>
</header><!-- .page-header -->
<div class="page-content">
<div class="search404">
<p><?php esc_html_e( 'Maybe try a search?', 'codilight-lite' ); ?></p>
<?php get_search_form(); ?>
</div>
<div class="latest-posts-404">
<h4><?php esc_html_e( 'Latest Posts', 'codilight-lite' ); ?></h4>
<?php
$custom_query = new WP_Query( apply_filters( 'page_404_latest_posts_args', array(
'post_type' => 'post',
'posts_per_page' => 6,
'post_status' => 'publish',
'ignore_sticky_posts' => true
) ) );
$count = 0;
if ( $custom_query->have_posts() ) :
echo '<div class="block1 block1_grid">';
echo '<div class="row">';
while ( $custom_query->have_posts() ) : $custom_query->the_post();
$count++;
?>
<article <?php post_class( 'col-md-4 col-sm-12' ); ?>>
<div class="entry-thumb">
<a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php the_title(); ?>">
<?php
if ( has_post_thumbnail( ) ) {
the_post_thumbnail( 'codilight_lite_block_2_medium' );
} else {
echo '<img alt="'. esc_html( get_the_title() ) .'" src="'. esc_url( get_template_directory_uri() . '/assets/images/blank325_170.png' ) .'">';
}
?>
</a>
<?php
$category = get_the_category();
if ( $category[0] ) {
echo '<a class="entry-category" href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'</a>';
}
?>
</div>
<div class="entry-detail">
<header class="entry-header">
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
<?php if ( 'post' === get_post_type() ) codilight_lite_meta_1();?>
</header><!-- .entry-header -->
<div class="entry-excerpt">
<?php echo codilight_lite_excerpt(120); ?>
</div><!-- .entry-content -->
</div>
</article><!-- #post-## -->
<?php
if ( $count % 3 == 0 ) {
echo '</div>';
echo '<div class="row">';
}
endwhile;
echo '</div>';
echo '</div>';
endif;
wp_reset_postdata(); // reset the query
?>
</div>
</div><!-- .page-content -->
</section><!-- .error-404 -->
</main><!-- #main -->
</div><!-- #primary -->
<?php get_footer(); ?>