create 404 page in wordpress theme

create 404 page in wordpress theme with classic design

Many wordpress theme developer when create new wordpress theme, they need to think about 404 page must. In this article I going to give you information about how to create 404 page in wordpress theme with classic design.

create 404 page in wordpress theme

What is 404 page?

The 404 or Not Found error message is an HTTP standard response code indicating that the client was able to communicate with the server but the server could not find what was requested. 404 errors should not be confused with “server not found” or similar errors, in which a connection to the destination server could not be made at all. Another similar error is “410: Gone”, which indicates that the requested resource has been intentionally removed and will not be available again. A 404 error indicates that the requested resource may be available in the future.

I recommend to wordpress theme developer create customize 404 page in wordpress theme. Go to google custom search engine page and get google search engine code for your website from following URL:

http://www.google.com/cse/

Use following code creating the 404 page in wordpress theme.


<?php get_header(); ?>

<?php get_sidebar(); ?>

<div class="text" style="padding:50px 0 0 150px; ">

<img src="<?php bloginfo('template_url'); ?>/images/octocat_happy.gif">
<h1 class="title">Page Not Found</h1>
<p>We are sorry about!</p>
<p>Please try search again from here:</p><br>

<form action="http://images.purabtech.in/search-result/" id="cse-search-box">
<div>
<input type="hidden" name="cx" value="partner-pub-4949877136251097:p4u7h8-3y7v" />
<input type="hidden" name="cof" value="FORID:10" />
<input type="hidden" name="ie" value="ISO-8859-1" />
<input type="text" name="q" size="25" />
<input type="submit" name="sa" value="Search" />
</div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>

</div>

<?php get_footer(); ?>

I used here my websites search engine code. Dont forget to change the google search engine code as your web site.

404-error-pages-for-your-website-7 create 404 page in wordpress theme
create 404 page in wordpress theme
The 404 or Not Found error message is an HTTP standard response code indicating that the client was able to communicate with the server but the server could not find what was requested. 404 errors should not be confused with “server not found” or similar errors, in which a connection to the destination server could not be made at all. Another similar error is “410: Gone”, which indicates that the requested resource has been intentionally removed and will not be available again. A 404 error indicates that the requested resource may be available in the future.

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.