First I would say somthing about archive page in any website. Archive page is very important for SEO purpose.

Google and search engine sites will always look for two main file. First sitemap.xml file and archive page.

If you do not having archive page in your website so you are lacking somewhere in SEO for your website.

What I am going to show in this article, How to create the archive page for worpdress theme or website.

In wordpress creating the archive is very easy. Follow my steps to create the archive page in wordpress site.

1. Open your wordpress theme folder and copy the single.php as named archive.php
Note: dont copy index.php file as archive.php. It may have different UI and programming attribute in index.php.

2. Then copy archive.php as archive_template.php new file.

3. Open the archive_template.php file and copy paste the following code in top of file.

<?php
/*
Template Name: Archives Page
*/
?>

4. Again open the archive_template.php file and find the post loop. Between the loop copy past the following code.

<h1> All Archives in dropdown</h1>
<select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'>
 <option value=""><?php echo attribute_escape(__('Select Month')); ?></option>
 <?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?> </select>

<br><br>
<h1> All category</h1>
<ul><?php wp_list_cats('sort_column=name&optioncount=1') ?></ul>

<br><br>
<h1> All Archives</h1>
<ul><?php wp_get_archives('type=monthly&show_post_count=1') ?></ul>

Above code will give you the archive with dropdown and archive with category name with post count and archive with month and post count.

5. After doing this upload two new files to server in wordpress theme folder (archive.php and archive_template.php).

6. Go to your wordpress Admin panel using browser

7. Create the new page with title “Archive” and put some information about your website in that page.(Dont publish the page wait and follow next steps.)

8. Check the template section (right side under attribute section). Choose archive page as template and publish and save the page.

That sit. You are able to see the archive page for your website.

You might also like

Some best WordPress Hacks for theme developer
WordPress Theme Template Files List
WordPress theme help from WordPress API
Show Random Posts in one page with WordPress
How to use is_page conditional tag in wordpress theme

2 Responses to “Create an Archive Page in your WordPress theme”

  1. Personally I think that Google Buzz’s release was a little too early, especially with the privacy issues. I really think that Google’s possibly going down the same future that Windows went through around the time of Windows ME. The latest products and releases appear to be less thought through and I also feel like rushed in an attempt to be 1st to market, and compete with a competitors release. The breach of privacy was an issue that did not require was a very simple issue to figure out, a very basic review would have shown such issues. Do you think Google may have received too much credit last year?

  2. [...] more here: Create an Archive Page in your WordPress theme Tags: archives, php, [...]

Leave a Reply

Wordpressapi is developer code book.
wordpressapi on Facebook
© 2010 Wordpressapi. All Rights Reserved. Reproduction without explicit permission is prohibited.