Last active
August 27, 2019 16:34
-
-
Save eugenoprea/4721124 to your computer and use it in GitHub Desktop.
Custom 404 Page for Genesis child themes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Handles display of 404 page. | |
* | |
* Edited by Eugen Oprea - http://www.eugenoprea.com/ | |
* | |
* This file should be added in the directory of your child theme! | |
* | |
* @category Genesis | |
* @package Templates | |
* @author StudioPress | |
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later) | |
* @link http://www.studiopress.com/themes/genesis | |
*/ | |
/** Remove default loop **/ | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action( 'genesis_loop', 'genesis_404' ); | |
/** | |
* This function outputs a 404 "Not Found" error message | |
* | |
* @since 1.6 | |
*/ | |
function genesis_404() { ?> | |
<div class="post hentry"> | |
<h1 class="entry-title"><?php _e( 'Uh-Oh! It looks like you are lost!', 'genesis' ); ?></h1> | |
<div class="entry-content"> | |
<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.', 'genesis' ), home_url() ); ?></p> | |
<p><?php printf( __( 'Or you can try a link from the navigation.' ) ); ?></p> | |
</div><!-- end .entry-content --> | |
</div><!-- end .postclass --> | |
<?php | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment