404.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 Scratchpad
  8. */
  9. get_header(); ?>
  10. <div id="primary" class="content-area">
  11. <main id="main" class="site-main" role="main">
  12. <section class="error-404 not-found">
  13. <header class="page-header">
  14. <h1 class="page-title"><?php esc_html_e( 'Oops! That page can&rsquo;t be found.', 'scratchpad' ); ?></h1>
  15. </header><!-- .page-header -->
  16. <div class="page-content">
  17. <p><?php esc_html_e( 'It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'scratchpad' ); ?></p>
  18. <?php
  19. get_search_form();
  20. the_widget( 'WP_Widget_Recent_Posts', '', 'before_title=<h2 class="widget-title">&after_title=</h2>' );
  21. // Only show the widget if site has multiple categories.
  22. if ( scratchpad_categorized_blog() ) :
  23. ?>
  24. <div class="widget widget_categories">
  25. <h2 class="widget-title"><?php esc_html_e( 'Most Used Categories', 'scratchpad' ); ?></h2>
  26. <ul>
  27. <?php
  28. wp_list_categories( array(
  29. 'orderby' => 'count',
  30. 'order' => 'DESC',
  31. 'show_count' => 1,
  32. 'title_li' => '',
  33. 'number' => 10,
  34. ) );
  35. ?>
  36. </ul>
  37. </div><!-- .widget -->
  38. <?php
  39. endif;
  40. /* translators: %1$s: smiley */
  41. $archive_content = '<p>' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', 'scratchpad' ), convert_smilies( ':)' ) ) . '</p>';
  42. the_widget( 'WP_Widget_Archives', 'dropdown=1', 'before_title=<h2 class="widget-title">&after_title=</h2>' . $archive_content );
  43. the_widget( 'WP_Widget_Tag_Cloud' );
  44. ?>
  45. </div><!-- .page-content -->
  46. </section><!-- .error-404 -->
  47. </main><!-- #main -->
  48. </div><!-- #primary -->
  49. <?php
  50. get_footer();