These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * The template for displaying 404 pages (not found). |
||
4 | * |
||
5 | * @link https://codex.wordpress.org/Creating_an_Error_404_Page |
||
6 | * |
||
7 | * @package Lighthouse |
||
8 | */ |
||
9 | |||
10 | get_header(); ?> |
||
11 | |||
12 | <div id="primary" class="content-area"> |
||
13 | <main id="main" class="site-main" role="main"> |
||
14 | |||
15 | <section class="error-404 not-found"> |
||
16 | <header class="page-header"> |
||
17 | <h1 class="page-title"><?php esc_html_e( 'Oops! That page can’t be found.', 'lighthouse' ); ?></h1> |
||
18 | </header><!-- .page-header --> |
||
19 | |||
20 | <div class="page-content"> |
||
21 | <p><?php esc_html_e( 'It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'lighthouse' ); ?></p> |
||
22 | |||
23 | <?php |
||
24 | get_search_form(); |
||
25 | |||
26 | the_widget( 'WP_Widget_Recent_Posts' ); |
||
27 | |||
28 | // Only show the widget if site has multiple categories. |
||
29 | if ( lighthouse_categorized_blog() ) : |
||
30 | ?> |
||
31 | |||
32 | <div class="widget widget_categories"> |
||
33 | <h2 class="widget-title"><?php esc_html_e( 'Most Used Categories', 'lighthouse' ); ?></h2> |
||
34 | <ul> |
||
35 | <?php |
||
36 | wp_list_categories( array( |
||
37 | 'orderby' => 'count', |
||
38 | 'order' => 'DESC', |
||
39 | 'show_count' => 1, |
||
40 | 'title_li' => '', |
||
41 | 'number' => 10, |
||
42 | ) ); |
||
43 | ?> |
||
44 | </ul> |
||
45 | </div><!-- .widget --> |
||
46 | |||
47 | <?php |
||
48 | endif; |
||
49 | |||
50 | /* translators: %1$s: smiley */ |
||
0 ignored issues
–
show
|
|||
51 | $archive_content = '<p>' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', 'lighthouse' ), convert_smilies( ':)' ) ) . '</p>'; |
||
52 | the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=</h2>$archive_content" ); |
||
53 | |||
54 | the_widget( 'WP_Widget_Tag_Cloud' ); |
||
55 | ?> |
||
56 | |||
57 | </div><!-- .page-content --> |
||
58 | </section><!-- .error-404 --> |
||
59 | |||
60 | </main><!-- #main --> |
||
61 | </div><!-- #primary --> |
||
62 | |||
63 | <?php |
||
64 | get_footer(); |
||
65 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.