Code for the 2012 WordPress Theme 404.php


This entry is part 3 of 4 in the series WordPress Themes

Here is the 404.php file for the WordPress theme Twenty Twelve.

This is just part of a series of different pages that make up a website.

With WordPress you don’t really need to know these codes but if you want to customize your site and move it away from the theme you are using, you may wish to look at the php and html code.

For example you may want to change the “somewhat embarrassing part to something else. That’s easy to do as you can see the characters below in the code and you just have to change then to what you want. The only hard part is learning how to use the Editor.

<?php
/**
 * The template for displaying 404 pages (Not Found)
 *
 * @package WordPress
 * @subpackage Twenty_Twelve
 * @since Twenty Twelve 1.0
 */

get_header(); ?>

	<div id="primary" class="site-content">
		<div id="content" role="main">

			<article id="post-0" class="post error404 no-results not-found">
				<header class="entry-header">
					<h1 class="entry-title"><?php _e( 'This is somewhat embarrassing, isn&rsquo;t it?', 'twentytwelve' ); ?></h1>
				</header>

				<div class="entry-content">
					<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentytwelve' ); ?></p>
					<?php get_search_form(); ?>
				</div><!-- .entry-content -->
			</article><!-- #post-0 -->

		</div><!-- #content -->
	</div><!-- #primary -->

<?php get_footer(); ?>
Series Navigation<< Code for the 2012 WordPress Theme footer.phpCode for the 2012 WordPress Theme header.php >>