Skip to content

Instantly share code, notes, and snippets.

@aaronhartland
Created August 16, 2012 14:00
Show Gist options
  • Save aaronhartland/3370325 to your computer and use it in GitHub Desktop.
Save aaronhartland/3370325 to your computer and use it in GitHub Desktop.
404 Page Layout - CellPath
<?php
/**
* CellPath 404 Page Layout
*
* @package CellPath
* @author Aaron Hartland, http://www.aaronhartland.com
* @copyright Copyright (c) 2012, Aaron Hartland
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*
*/
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'cellpath_404_loop_helper' );
/**
* Add widget support for the 404 page.
* If no widgets active, display the default loop/message.
*
*/
function cellpath_404_loop_helper() {
if ( is_active_sidebar( '404-page' ) ) {
dynamic_sidebar( '404-page' );
}
else {
genesis_standard_loop();
}
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment