Custom Archives

March 15, 2009

Thesis comes with a default archive page. It’s fine, but I wanted mine to show more. I found out how to accomplish it via the DIY Forums and the WordPress Codex. Here’s the code to add to the custom_functions.php:

/* Custom Archives Page */
function my_archive() {
?>
<div class="archive">
<div class="archivel">
  <h3>By Month:</h3>
  <ul>
    <?php wp_get_archives('type=monthly'); ?>
  </ul>
  <h3>By Category:</h3>
  <ul>
    <?php wp_list_categories('sort_column=name&title_li='); ?>
  </ul>
   <h3>By Tag:</h3>
 <?php wp_tag_cloud('smallest=10&largest=10&format=list'); ?>
</div>
<div class="archiver">
   <h3>By Post: (Last 100 articles)</h3>
   <ul>
     <?php wp_get_archives('type=postbypost&limit=100'); ?>
   </ul>
</div>
</div>
<?php
}
remove_action('thesis_hook_archives_template', 'thesis_archives_template');
add_action('thesis_hook_archives_template', 'my_archive');

  1. Next go into your WordPress dashboard and create a new page.
  2. Name that page “Archives” and choose the “Archives” template.
  3. Publish the page.
  4. Now go to the “Thesis Options” page under “Appearance.”
  5. Go to the “Navigation Menu” and click on “Archives” to include it in the nav menu.
  6. Click on the “Big Ass Save Button.”

That’s it!

Leave a Comment

Previous post:

Next post: