Balkhis - Vision For Success

How to add an archive page in wordpress?

Dear Readers, I would like to thank you for reading this post. I highly value your feedback and would like to know more about my readers. Follow me on Twitter

As you see, recently with the new design I have added an archives page in Balkhis. I had alot of people asking me the questions which I have already answered in my previous posts, so therefore I thought adding a page like that would help. Plus as I see from a users end on problogger, I like the archive page there. So in this post, I will be sharing how you can add an archive page to your wordpress blog.

First step is to open a new .php file, and name it blogarchive.php. Remember whatever you do, do not name the file archive.php because it will conflict with your database and not show the results correctly.

Second step, you want to do is give this page a template name, so it can have its own style. Copy and paste the codes below, this must be at the very top. Even above your include header codes.

To watch a video how I did it you can refer back to my old post on How to create your own custom wordpress page?

Well once that is done, now you can add the design elements in your archive page. You can add By month, By Category, By Tags basically anything you want in there.

To give you some options check out the list below:

Show archives by month – <?php wp_get_archives(‘type=monthly’); ?>

Show archives by categories – <?php wp_list_cats(); ?>

Show archives by tag – <?php wp_tag_cloud(‘smallest=8&largest=12&unit=pt&number=30&format=list&order=RAND’); ?>

Show some of the recent posts – <?php get_archives(‘postbypost’, ’17′, ‘custom’, ‘<li>’, ‘</li>’); ?>

Add a Search Bar you have the codes for that.

You can basically add anything that you like. For an example check out Balkhis Archive Page

Now linking to archives is creating duplicate content in the blog, as I mentioned in my post about Duplicate content, so what you need to do is get the most essential plugin for a wordpress blog called All in One SEO Pack and put the settings as I have shown in my post about All in one SEO Plugin.

Hopefully this will help some people who were looking to add an archive page in their wordpress blog.



To stay updated with the blog, please consider subscribing to my full feed RSS. You can also subscribe by Email and have new posts sent directly to your inbox. I hate spam as well, so I promise you that you will not be spammed.
Add to Social Bookmarks:
Add this Article to Digg Add this Article to Stumbleupon Add this Article to Del.icio.us Add this Article to Reddit Add this Article to Newsvine Add this Article to Technorati

RSS feed

4 Comments

Comment by Enkay Blog
2008-06-28 15:43:41

Hey, great post about adding an Archive page since it is definitely a big plus for new users to explore your old posts.


 
2008-07-18 07:31:11

[...] Make an Archive Page for your WordPress. [...]


 
2008-11-27 07:50:30

[...] on the sidebar to 6. Change the limit number as you please. Now the idea of this is that you have a separate archive page. That contains all the other years and what ever else you want. But the above codes you use to [...]


 
Comment by Viraj Sawant
2009-01-16 16:59:46

Very useful stuff. Will try out on my blog


 

Sorry, the comment form is closed at this time.

Subscribe to Balkhis via RSS
Subscribe to Balkhis via Email Pimp My Blog