Repository navigation
Expand file tree
/
Copy path404.php
More file actions
83 lines (63 loc) · 1.94 KB
/
Copy path404.php
File metadata and controls
83 lines (63 loc) · 1.94 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/**
* UTC Tailwind Genesis.
*
* This file adds the single post template to the UTC Tailwind Genesis Theme.
*
* @package UTC Tailwind Genesis
* @author Bridget Hornsby
* @license GPL-2.0-or-later
* @link https://github.com/UTCWeb/utc-tailwind-genesis-theme
*/
//force full-width
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );
// Adds entry meta in entry footer.
remove_action( 'genesis_loop', 'genesis_do_loop' );
remove_action( 'genesis_loop', 'genesis_404' );
add_action( 'genesis_loop', 'custom_entry_content' ); // Add custom loop
function custom_entry_content() {
genesis_markup(
[
'open' => '<article class="entry">',
'context' => 'entry-404',
]
);
genesis_markup(
[
'open' => '<h1 %s>',
'close' => '</h1>',
'content' => apply_filters( 'genesis_404_entry_title', __( 'Page not found.', 'genesis' ) ),
'context' => 'entry-title',
]
);
$genesis_404_content = sprintf(
/* translators: %s: URL for current website. */
__( 'The page you are looking for has either moved or does not exist. Perhaps you can return back to the <a href="%s">homepage</a> and see if you can find what you are looking for. Or, you can try finding it by using the search form below.', 'genesis' ),
esc_url( trailingslashit( home_url() ) )
);
$genesis_404_content = sprintf( '<p>%s</p>', $genesis_404_content );
/**
* The 404 content (wrapped in paragraph tags).
*
* @since 2.2.0
*
* @param string $genesis_404_content The content.
*/
$genesis_404_content = apply_filters( 'genesis_404_entry_content', $genesis_404_content );
genesis_markup(
[
'open' => '<div %s>',
'close' => '</div>',
'content' => $genesis_404_content . get_search_form( 0 ),
'context' => 'entry-content',
]
);
genesis_markup(
[
'close' => '</article>',
'context' => 'entry-404',
]
);
}
// Runs the Genesis loop.
genesis();