follow mejoin mesubscribe

Customize the Genesis 404 Page

Customizing the Genesis Theme Framework 404 page is really pretty easy.  Of course you can simply copy the 404.php from the Genesis theme folder into your child theme folder and make your edits there.  However, I just tend to leave the bulk of the 404 page alone and add a custom image to the top of the page.  It’s pretty simple to do via functions.php, though not all of the usual hooks are available.  The following code will output an image before the Not Found title.

add_action('genesis_before_post', 'child_404_image');
/**
 * Add an image to the top of the 404 page
 *
 * @author Jen Baumann
 * @link http://dreamwhisperdesigns.com/?p=631
 */
function child_404_image() {
	if( is_404() )
	echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/404.png" alt="OOPS, Nothing Found" />';
}

Place the code in the functions.php file, anywhere after this:

require_once(TEMPLATEPATH.'/lib/init.php');

And before the following closing code (if it exists):

?>

Don’t forget to upload your 404.png image file to the theme images folder.

About Jennifer Baumann

I am an avid horseback rider, animal lover, and freelance designer. I love working with WordPress and Genesis and work for Copyblogger Media as a Technical Support Advocate.

Dream Whisper Designs is Powered by Genesis

StudioPress Premium WordPress Themes

Genesis empowers you to quickly and easily build incredible websites with WordPress. Whether you're a novice or advanced developer, Genesis provides the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go. It's that simple - start using Genesis now!

Take advantage of the 6 default layout options, comprehensive SEO settings, rock-solid security, flexible theme options, cool custom widgets, custom design hooks, and a huge selection of child themes ("skins") that make your site look the way you want it to. With automatic theme updates and world-class support included, Genesis is the smart choice for your WordPress website or blog.