Created
May 3, 2013 17:42
-
-
Save menslow/5511828 to your computer and use it in GitHub Desktop.
CMS driven 404 page for Genesis Framework
This file contains 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. | |
* | |
* This file requires the creation of a page with the slug 'page-not-found' | |
*/ | |
function jb_page_404(){ | |
genesis_custom_loop( array('pagename' => 'page-not-found', 'posts_per_page' => 1 ) ); | |
} | |
/* Remove default loop */ | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action( 'genesis_loop', 'jb_page_404' ); | |
genesis(); |
I would opt to save the 60 lines of code and just make sure you create the "page-not-found"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately, this does not provide the Genesis 404 functionality if the page isn't created. That's what the other 60 lines were for. :)