Advertisement
srikat

404.php

Dec 9th, 2017
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. <?php
  2. /**
  3. * Genesis Framework.
  4. *
  5. * WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances.
  6. * Please do all modifications in the form of a child theme.
  7. *
  8. * @package Genesis\Templates
  9. * @author StudioPress
  10. * @license GPL-2.0+
  11. * @link http://my.studiopress.com/themes/genesis/
  12. */
  13.  
  14. // Remove default loop.
  15. remove_action( 'genesis_loop', 'genesis_do_loop' );
  16.  
  17. add_action( 'genesis_loop', 'genesis_404' );
  18. /**
  19. * This function outputs a 404 "Not Found" error message.
  20. *
  21. * @since 1.6
  22. */
  23. function genesis_404() {
  24.  
  25. genesis_markup( array(
  26. 'open' => '<article class="entry">',
  27. 'context' => 'entry-404',
  28. ) );
  29.  
  30. printf( '<h1 class="entry-title">%s</h1>', apply_filters( 'genesis_404_entry_title', __( 'Not found, error 404', 'genesis' ) ) );
  31. echo '<div class="entry-content">';
  32.  
  33. if ( genesis_a11y( '404-page' ) ) {
  34. echo '<h2>' . __( 'Sitemap', 'genesis' ) . '</h2>';
  35. genesis_sitemap( 'h3' );
  36. } else {
  37. genesis_sitemap( 'h4' );
  38. }
  39.  
  40. if ( genesis_html5() ) :
  41.  
  42. echo apply_filters( 'genesis_404_entry_content', '<p>' . sprintf( __( 'The page you are looking for no longer exists. Perhaps you can return back to the site\'s <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' ), trailingslashit( home_url() ) ) . '</p>' );
  43.  
  44. get_search_form();
  45.  
  46. else :
  47. ?>
  48.  
  49. <p><?php printf( __( 'The page you are looking for no longer exists. Perhaps you can return back to the site\'s <a href="%s">homepage</a> and see if you can find what you are looking for. Or, you can try finding it with the information below.', 'genesis' ), trailingslashit( home_url() ) ); ?></p>
  50.  
  51.  
  52.  
  53. <?php
  54. endif;
  55.  
  56. echo '</div>';
  57.  
  58. genesis_markup( array(
  59. 'close' => '</article>',
  60. 'context' => 'entry-404',
  61. ) );
  62.  
  63. }
  64.  
  65. genesis();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement