Creating A Custom 404 Page in WordPress Without Using Plugins
I have recently changed my blog theme to The Seven Five is a semi-automatic “Lifestream” WordPress theme, the theme is great & I am luving it. I added some pages like archives page, 404 error page. I could have added a plugin for a 404 page but I like to make a own custom 404 error page, you can check my 404 page. It is very simple & you can do to just by doing the following steps
# Create a 404.php page in your themes folder if you do not have one. It’s best to use the same styles your blog so that it looks a part of the blog.
# Add the basic Add these basic code lines in your 404 file. The beast way is to put the same Header, footer lines & and insert content as u wish.
<?php get_header(); ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
These are some of the tags that you can use:
Display Archive by Months:
<?php wp_get_archives(’type=monthly’); ?>
This code will display archive by months, but it will list all months.
Display list of Categories
<?php wp_list_cats(); ?>
This code will list all categories on your blog. you can style them however using list tags or others.
Display Recent Posts
<?php get_archives(’postbypost’, ‘17?, ‘custom’, ‘<li>’, ‘</li>’); ?>
This shows the most recent Posts written on your Blog.
There are other tags too which can be used but these are the most basic ones to use.
November 21, 2009
One response to Creating A Custom 404 Page in WordPress Without Using Plugins
Pingback: SCOTT