404 error pages often appear in your specific part of your website or blog is deceased or not. The default 404 error message will say “page not found” or something to that extent. How do I create 404 templates, which users can edit in the WordPress admin panel?
A typical 404 error page is a terrible way to greet visitors who are interested in a specific page on your website. It is a waste of time, because ultimately nothing but an error.
Register your 404 widget area with WordPress
Like any other widget area, we need to let WordPress know about it. Open your theme’s functions.php file and add this PHP code in:
<?php
register_sidebar( array(
'name' => '404',
'id' => '404',
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
) );
?>
If you’re releasing this theme publicly, you should localize the widget area name but not the id.By adding a widget area, we’re providing users to have full control over their 404 page.
Displaying the widget area on your 404 pages
Open your theme’s 404.php template and add this to the content area or replace it completely:
<?php dynamic_sidebar( '404' ); ?>
You have done it.Now you can easily edit your 404 template at any time without having to opening your themes files.
Other way to customization
From the Admin Dashboard, Select Presentation > Theme Editor > 404.php
You decide what you want to show to the visitors
Add these modifications in your 404 file.For adding a search button on this page or let them found the categories and links so that they follow whatever for what they are looking at your blog.
Search Feature
<form method=”get” id=”searchform” action=”<?php bloginfo(’url’); ?>/”>
<div><input type=”text” value=”<?php the_search_query(); ?>” name=”s” id=”s” />
<input type=”submit” id=”searchsubmit” value=”Search” />
</div>
</form>
You might also want to add google adsense search button in it instead of your own search feature which will help you monetize.
Archives By Month
<h2>Archives by Month:</h2>
<ul>
<?php wp_get_archives(’type=monthly’); ?>
</ul>
Archives by Category
<h2>Archives by Subject:</h2>
<ul>
<?php wp_list_cats(); ?>
</ul>
Use following code for showing weekly archives