forked from oceanwp/oceanwp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
404.php
151 lines (91 loc) · 3.62 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
/**
* The template for displaying 404 pages.
*
* @package OceanWP WordPress theme
*/
// Get ID
$get_id = get_theme_mod( 'ocean_error_page_template' );
// Check if page is Elementor page
$elementor = get_post_meta( $get_id, '_elementor_edit_mode', true );
// Get content
$get_content = oceanwp_error_page_template_content();
// If blank page
if ( 'on' == get_theme_mod( 'ocean_error_page_blank', 'off' ) ) { ?>
<!DOCTYPE html>
<html <?php language_attributes(); ?><?php oceanwp_schema_markup( 'html' ); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<!-- Begin Body -->
<body <?php body_class(); ?><?php oceanwp_schema_markup( 'body' ); ?>>
<?php do_action( 'ocean_before_outer_wrap' ); ?>
<div id="outer-wrap" class="site clr">
<?php do_action( 'ocean_before_wrap' ); ?>
<div id="wrap" class="clr">
<?php do_action( 'ocean_before_main' ); ?>
<main id="main" class="site-main clr"<?php oceanwp_schema_markup( 'main' ); ?>>
<?php
} else {
get_header();
} ?>
<?php do_action( 'ocean_before_content_wrap' ); ?>
<div id="content-wrap" class="container clr">
<?php do_action( 'ocean_before_primary' ); ?>
<div id="primary" class="content-area clr">
<?php do_action( 'ocean_before_content' ); ?>
<div id="content" class="clr site-content">
<?php do_action( 'ocean_before_content_inner' ); ?>
<article class="entry clr">
<?php
// Check if there is a template
if ( ! empty( $get_id ) ) {
// If Elementor
if ( OCEANWP_ELEMENTOR_ACTIVE && $elementor ) {
OceanWP_Elementor::get_error_page_content();
}
// If Beaver Builder
else if ( OCEANWP_BEAVER_BUILDER_ACTIVE && ! empty( $get_id ) ) {
echo do_shortcode( '[fl_builder_insert_layout id="' . $get_id . '"]' );
}
// Else
else {
// Display template content
echo do_shortcode( $get_content );
}
}
// Else
else { ?>
<div class="error404-content clr">
<h2 class="error-title"><?php esc_html_e( 'This page could not be found!', 'oceanwp' ) ?></h2>
<p class="error-text"><?php esc_html_e( 'We are sorry. But the page you are looking for is not available.', 'oceanwp' ); ?><br /><?php esc_html_e( 'Perhaps you can try a new searching.', 'oceanwp' ); ?></p>
<?php get_search_form(); ?>
<a class="error-btn button" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e( 'Back To Homepage', 'oceanwp' ) ?></a>
</div><!-- .error404-content -->
<?php } ?>
</article><!-- .entry -->
<?php do_action( 'ocean_after_content_inner' ); ?>
</div><!-- #content -->
<?php do_action( 'ocean_after_content' ); ?>
</div><!-- #primary -->
<?php do_action( 'ocean_after_primary' ); ?>
</div><!--#content-wrap -->
<?php do_action( 'ocean_after_content_wrap' ); ?>
<?php
// If blank page
if ( 'on' == get_theme_mod( 'ocean_error_page_blank', 'off' ) ) { ?>
</main><!-- #main-content -->
<?php do_action( 'ocean_after_main' ); ?>
</div><!-- #wrap -->
<?php do_action( 'ocean_after_wrap' ); ?>
</div><!-- .outer-wrap -->
<?php do_action( 'ocean_after_outer_wrap' ); ?>
<?php wp_footer(); ?>
</body>
</html>
<?php
} else {
get_footer();
} ?>