WordPress – Improve your 404 File Not Found answers (2 of 4)
In our previous post we have shown how to provide your viewers with a tool to let them stay in your WordPress website when they get a 404 File Not Found error. In this post we are going to perform a new step forward, we will provide them with another tool, a Site Map to give them more chances…
| Applies to:
WordPress 2.8 |
These customizations are provided “AS IS” without warranty of any kind and DiceLock Security disclaims all warranties, EITHER EXPRESS OR IMPLIED INCLUDING THOSE OF MERCHANTABILITY, NONINFRINGEMENT OF THIRD-PARTY INTELLECTUAL PROPERTY, OR FITNESS FOR A PARTICULAR PURPOSE.
Upgrading or reinstalling the customized source code (package, plugin, component, …) may remove the customizations performed. |
In our previous post we have shown how to add a Search box in your 404 File Not Found error page, allowing your viewers to search what they are looking for, as in:
There is another tool that improves you web site, this is Dagon Design Sitemap Generator. It allows to create a site map of your web site in the fly, like in DiceLock Security Blog Site Map.
One way to allow your 404 File Not Found viewers go further your web site is to display a link to your Site Map when they get the 404 File Not Found. This will show them that a Site Map exist and they will be able to see all your content and find what they are looking for.
As in previous post, you can put in your 404 File not Found page, maybe in your 404.php or in index.php (located under atahualpa folder) in Atahualpa theme as in the exemple a Site Map link. The 404 File Not Found page would be in Atahualpa theme:
<?php // END of: If there are any posts // If there are no posts: else : ?> <h2><?php _e('Not Found','atahualpa'); ?></h2> <table width="100%"> <tr> <td colspan="2"> <br /><p><?php _e("Sorry, but you are looking for something that it's not found. ","atahualpa"); ?></p><br /> </td> </tr> <tr> <td colspan="2"> <b>Site Map</b><br /><br /> You can access the <a href="site-map/">Site Map</a> in order to view all blog content, maybe you can access the information you are looking for from there !!!<br /><br /> </td> </tr> <tr> <td colspan="2"> <br /><br /><b>Site search</b><br /><br /> Or you can use our search form to find the proper information you are looking for ...<br /><br /> </td> </tr> <tr> <td width="50%"> <?php get_search_form(); ?><br /><br /> </td> <td> </td> </tr> </table> <?php endif; ?> <?php get_footer(); ?>
Where the inserted code is:
<tr> <td colspan="2"> <b>Site Map</b><br /><br /> You can access the <a href="site-map/">Site Map</a> in order to view all blog content, maybe you can access the information you are looking for from there !!!<br /><br /> </td> </tr>
With this modification your viewers will get the following screenshot when they get a 404 File Not Found error:
In this way, your viewers will get in front of their eyes tools that will make them to stay in your site making them comfortable.



































