/
404.php
86 lines (59 loc) · 1.83 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
<?php
/**
* The template for displaying 404 pages (Not Found).
*
* @package gp
* @since gp 1.0
*/
gp_add_html_class( 'horizontal-page no-scroll' );
get_header();
/**
* Find pages that have full page slider template. Search those pages for big images.
*/
$slider_pages = it_find_page_by_template( 'template-full-page-slider.php', 'post_status=publish' );
$image = false;
foreach ( $slider_pages as $slider_page ) {
$slides = gp_slider_get_published_slides( $slider_page->ID );
if ( $slides && is_array( $slides ) ) {
shuffle( $slides );
foreach ( $slides as $slide ) {
$image = wp_get_attachment_image_src( $slide->ID, 'gp-max' );
// We found our first image!
if ( $image ) {
$image = $image[0];
$data = gp_slider_get_slide_data( $slide->ID );
break;
}
}
}
// Stop as soon as we find first image.
if ( $image ) {
break;
}
}
$attr = array(
'class' => 'page-with-background'
);
if ( $image ) {
$attr['style'] = array(
isset( $data['background_position'] ) ? $data['background_position'] : 'center center',
'background-image: url(' . esc_url( $image ) . ')'
);
}
?>
<div id="main" class="site">
<div <?php echo it_array_to_attributes( $attr ); ?>>
<article id="post-0" class="post error404 not-found js-vertical-center">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Uups! Diese Seite konnte nicht gefunden werden.', 'gp' ); ?></h1>
</header>
<div class="entry-content">
<p><?php _e( 'Es sieht so aus das hier nichts gefunden werden kann. Probieren Sie die Navigation oben.', 'gp' ); ?></p>
<!-- <p><?php _e( 'Es sieht so aus das hier nichts gefunden werden kann. Probieren Sie die Navigation oben oder die Suche.', 'gp' ); ?></p> -->
<?php // get_search_form(); ?>
</div>
</article>
</div>
</div>
<?php
get_footer();