Tutorial: Create a Very Informative Archives Page
Create a Very Informative Archives Page

Tutorial: Create a Very Informative Archives Page

by Alex · 33 comments

I don’t mean to toot my own horn here, but have you seen our Archives page? It’s pretty awe­some if I do so say so myself, and I received numer­ous emails and com­ments about how I made my Archives page. So today, I’m going to show you how!

I will try to make this tuto­r­ial as detailed as pos­si­ble so you can cre­ate an almost exact replica of our Archives page onto your own blog.

Down­load this Entire Tutorial

At the end, I am going to post a file you can down­load that will be com­pat­i­ble with a reg­u­lar Word­Press theme, and if you use The­sis, the entire function!

Check­list

Here are some of the things you will need below to do this tuto­r­ial. Not every­thing is nec­es­sary, but I am writ­ing the tuto­r­ial to match our Archives exact.

    Plu­g­ins
  1. Smart Archives Reloaded
  2. Recent Posts Plugin
  3. (Optional) Ran­dom Posts Plugin
  4. Files Needed
  5. Stan­dard Word­Press Themes: style.css, archives.php
  6. The­sis Theme Users: custom.css, custom_functions.php

Set­ting up the Page

I always like to set up the HTML before I start styling the page, so I am going to break down every­thing on the page in this sec­tion and you can add what­ever you want, and exclude any­thing you don’t want.

A. Search Box

Give the user the option to search your blog from your Archives page.

<h5>Search Blogussion</h5>
<p>Use this search form below to look for a specific posts with specific keywords in them.</p>

<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
<input size="20" type="text" value="To search, type and hit enter" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" name="s" id="s" />
</form>

B. Dis­play Smart Archives

Mov­ing along, we have the smart archives sec­tion. It looks like this, right under the Search form:

This plugin automatically links to monthly archives by the year.

This plu­gin auto­mat­i­cally links to monthly archives by the year.

Adding this to your page is sim­ple, just add the line <?php smart_archives(); ?> wher­ever you want it to appear.

By default, Smart Archives shows a list of your blog posts, and just the block show­ing the monthly archives. To just show the monthly archives, go into your Admin panel and go to Set­ting → Smart Archives → For­mat → Tick the “block” option and click “Save Changes.”

C. “Search by” Box

The box that shows “Search by Cat­e­gory,” “by Author” and “Ran­dom Posts” is extremely use­ful, and also the most infor­ma­tive part on this whole archives page. You can change what­ever con­tent you want to dis­play in this box with lit­tle cod­ing knowledge.

Here is the code to out­line the box:

<div id="searchby">
 	<div id="inner">
 		<ul>
 			<li class="title">Search By Category</li>
 			<?php wp_list_categories('&title_li='); ?>
 		</ul>

 		<ul>
 			<li class="title">Search By Author</li>
 			<?php wp_list_authors('show_fullname=1&optioncount=1&'); ?>
 		</ul>

		<ul>
			 <li class="title">Random Posts</li>
			 <?php random_posts(); ?>
		 </ul>
	 </div>
 </div>

You can change what­ever you would like to in there. I rec­om­mend you at least keep cat­e­gories and Authors (if you have more than one author).

D. Dis­play Lat­est Posts

This may or not be use­ful to you, it depends on what you like on your Archives page. The code below is assum­ing you have the highly cus­tomiz­able Lat­est Posts plu­gin (see check­list above).

Paste this wher­ever you want:

<h5>10 Latest Posts</h5>
 <?php recent_posts(); ?>

For for­mat­ting like our Lat­est Post options (again, assum­ing you used the plu­gin from the check­list) fol­low these steps. Go to your Admin Panel → Set­tings → Recent Posts → Out­put (at top of page) → and type in the fol­low into “Out­put template:”

<div class="recent">
	<h3>{link}</h3>
	<p>{date} &middot; {commentcount} Comments &middot; <a href="{url}#phighlights">Summary</a></p>
	<p>{snippet} [...]</p>
	<p><a href="{url}">Read Full Post &rarr;</a></p>
</div>

E. Tag Cloud

I think you should always have one of these things float­ing around (even as obnox­ious look­ing as they are)!

<h5>An Obnoxious Looking Tag Cloud</h5>
 <?php wp_tag_cloud(); ?>

Styling the Page

Now that we have our page set up, it’s time to add the CSS to it! This will make our code dis­play prop­erly instead of the jum­bled up mess it prob­a­bly is right now!

The search box and Smart Archives do not need any cus­tom styling. They will just inherit the styles from your own theme you are using now.

A. Style the “Search by” Box

This box has a few dif­fer­ent things going on here, so I am going to break it down for you.

Cre­at­ing the Outline
The black box surrounding the white box is just to make it look good

The black box sur­round­ing the white box is just to make it look good

The out­line in my opin­ion makes the box look pretty good. It should match any style as it is black and white. It’s a per­sonal choice to include the out­line, I think it does make it stand out a lit­tle bit. But it is very easy to remove it, so if you don’t want it then you just sim­ply need to remove the #searchby line in your Style sheet.

Here is the CSS code to add that outline:

#searchby{background: #454343 url(images/blackGrad.gif) repeat-x; border: 1px solid #0A0A0A; border-top: 0; margin-bottom: 1.5em; overflow: hidden; padding: 1em }

#searchby #inner {background: #FFF; border: 1px solid #000; overflow: hidden }

Here is the black gra­di­ent used in the box, if you would like to use it on your blog as well:

Right Click ? Save Image As

Right Click → Save Image As

Align the Boxes into 3 Columns

With­out this CSS, your boxes are prob­a­bly ver­ti­cally aligned, instead of next to each other (hor­zon­tally aligned). With just one line of code, you can make these columns next to each other:

#searchby ul {float: left; list-style-position: inside; margin: 0; padding: 1em; width: 28%}

You can change the width and padding how­ever you like until it fits your theme. I use per­cent­ages because of the way this theme in par­tic­u­lar is coded, and you might want to use a dif­fer­ent kind of for­mat­ting like PX or EM instead. It’s up to you though.

Other Lit­tle Styles

Here are just some other things you can add to make the box look better:

#searchby li { padding-bottom: 4px }

#searchby li.title{ font-size: 18px; list-style-type: none }
The Whole Code
#searchby{background: #454343 url(images/blackGrad.gif) repeat-x; border: 1px solid #0A0A0A; border-top: 0; margin-bottom: 1.5em; overflow: hidden; padding: 1em }

#searchby ul {float: left; list-style-position: inside; margin: 0; padding: 1em; width: 28%}

#searchby li { padding-bottom: 4px }

#searchby li.title{ font-size: 18px; list-style-type: none }

#searchby #inner {background: #FFF; border: 1px solid #000; overflow: hidden }

B. Style Lat­est Posts

There is just a few styles here, this will give it more for­mat­ting and make it look great.

.recent { border-bottom: 1px dashed #CCC; margin-bottom: 2em }

	.recent h3 a { font-size: 22px; line-height: 20px; text-decoration: none }

	.recent .metadata { color:#888; font-size:11px; text-transform:uppercase}

Looks Pretty Good, Right?

If you have every­thing work­ing, then I am sure you will be happy with the results! Post here if you have any prob­lems, or notice any mis­takes in this tuto­r­ial. You can pro­ceed to down­load the source code for the tuto­r­ial below.

Down­load Options

Do you use The­sis? Use this link below to get the entire func­tion to this tutorial:

Down­load The­sis Com­pat­i­ble Archives

Don’t use The­sis? Use this for other themes:

Down­load

Go to top

Article by Alex

I'm the 17 year old blogger & designer behind Blogussion. I live in New Jersey (but root for the New England Patriots), and am a Junior in High School. You can check out my rarely updated personal(ish) blog, Asnio, or connect with me on Twitter.

From Planning to Earning

A free course that explains all you need to know about maintaining and building a powerful, money making blog.

Information is delivered through a beautiful web guide & a 10 day email course (+ a weekly newsletter). Sign up, or learn more!

Abdul June 14, 2009 at 4:42 pm

Great tutorial, I’m going to try to get this up on my blog since I also use Thesis. Thanks for sharing it :) I would however love to see a tutorial on how you got your “You May Also Be Interested In…” to display the thumbnails and the “subscribe now” box on the opposite side.
Abdul´s last blog ..Content That Will Keep Visitors Coming Back

Reply

Alex June 14, 2009 at 9:18 pm

Thanks for the comment Abdul.

I have actually included that in this tutorial here: http://www.blogussion.com/blog/thesis/4-ways-customized-thesis-theme :)
Alex´s last blog ..Maximize Your Earnings Through the Thesis Affiliate Program

Reply

Abdul June 15, 2009 at 3:06 am

Ah great! Thanks for sending me there, I probably would have never found it.
Abdul´s last blog ..Content That Will Keep Visitors Coming Back

Reply

Alex June 15, 2009 at 7:54 pm

No problem Abdul, the more people that see that tutorial the better! ;)

Reply

Harish | Blogging Kid June 15, 2009 at 8:23 am

Great post Alex. But honestly this post is no where related to me as I don’t know even a dim about coding. And if I try it I get into muddle with it LOL. But awesome tutorial Alex. Should learn a little of designing and coding from you :)

Reply

Alex June 15, 2009 at 7:53 pm

Thanks Harish! Well, the code is all there for you if you want to take a few stabs at it. But yeah, learning some coding for your blog will totally help you later down the road!

Reply

Mandy June 15, 2009 at 8:25 am

Hi Alex,

I’m a thesis user and I just want to check something before I do this tutorial.

Do I create an archives page in wordpress and choose the archive template, then I just copy and paste the relevant code into the custom css and custom functions files in thesis?

Also i’m running WP2.8 and I noticed some of the plugins are only compatible up to 2.6.2 do you think they’ll still work?

Reply

Alex June 15, 2009 at 7:53 pm

Hey Mandy, good question.

Yes, create a new page for archives. By default, Thesis gives you an Archives template already, so just choose that from the “Page Templates” dropdown box in your admin panel. All of the plugins used in the tutorial do work, as they are all pulled right from this blog, and we run on 2.8!

Let me know how it works for you, and good luck! :)

Reply

Mandy June 20, 2009 at 4:34 pm

My page templates drop down menu seems to have disappeared from my admin menu, I just have parent page and order options left, have you had this problem?

Reply

Ali Hussain June 15, 2009 at 7:44 pm

Thankyou for the information and the tutorial, but I think the archive page should not be too much crowded. I display, last 30 posts as well as the most commented posts and a full archive of the posts in an ajax drop-down style.
Ali Hussain´s last blog ..Twitter Taking Over

Reply

Alex June 15, 2009 at 7:48 pm

That even sounds a little crowded! Do you at lest style the posts so they are more readable then just listing them? I hate going through lists like that. :p

Reply

xphunt3r June 15, 2009 at 11:59 pm

this is the thing fro you i am looking for thanks and great dude
xphunt3r´s last blog ..Awesome Eyes in Photoshop

Reply

Web Hosting Blog June 17, 2009 at 5:46 am

This is brilliant! Nice tutorial. Book marked for future purpose.
Thanks

Reply

James 'Thesis Theme Lover' Mann June 17, 2009 at 7:35 am

I have started using Thesis and can’t get enough of it. Currently I am in the middle, well maybe more at the start, of installing thesis on all of my blogs. I have 4 of my 30 some blogs done at this point.

I am learning new things I can do every day but I never thought about making my archive pages more informative and attractive. I will be doing this now as I install thesis on my other blogs.

Keep creating these great posts, they are saving me tons of time.

Reply

Alex June 20, 2009 at 8:56 pm

I’m currently using a plugin called ‘Sexy Bookmarks’, but as I’m always looking for ways to cut down on the plugins that I use, this is perfect for what I want. Thanks for yet another great tutorial.
Alex´s last blog ..Weekend Round-Up 6/20

Reply

JHS July 9, 2009 at 2:15 am

There is one thing missing: The code that places the thumbnail image in the related posts section as on the Blogussion archives page. Can you provide that, please? Thanks!
JHS´s last blog ..Sunday Stealing: The “I’ve come to realize . . . ” Meme

Reply

Ashton July 15, 2009 at 4:01 pm

Hello Alex, this seems like a great post, just wanted to know how can I make this work for the “Pages” instead of the “Posts” I use my pages as Articles. I would like to create an archive like yours to display the “Articles” [AKA- pages] not the posts. I’m using Thesis to make-over my Blog and could really use the code to insert.
~ Thanks in advance
Ashton´s last blog ..Ask the Right Questions First

Reply

Genaro September 19, 2009 at 1:39 pm

Great tutorial.

Unfortunately, I can’t Install the smart archives plugins.
it says : Parse error: syntax error, unexpected T_CLASS in /homez.302/naromind/www/wp-content/plugins/smart-archives-reloaded/smart-archives-reloaded.php on line 54

I am using wordpress 2.8.4 and thesis theme

Thank you for your help
Genaro´s last blog ..Ce que Google ne fera jamais pour moi

Reply

Barbara September 27, 2009 at 8:43 am

Thanks for your stellar tutorial about customizing archives, Alex, and the accompanying code. I, a true noob using Thesis to start up a cooking blog, have a follow-up “additional needs” question about customizing my archives page to make it more user friendly.

Here goes: the content of my posts – recipes – is not very time specific, so organizing my archives page in the normal way, by year/month, is not needed. Instead, I would like to organize my archives page, as follows:

1) By category, with post title list in alphabetical order.
2) By selected tags, with post title list in alphabetical order.
3) All posts, with post title list in alphabetical order.

I know it’s a big ask, but do you have any additional advice about how to get all this into the custom_functions.php file?

Reply

Alf October 27, 2009 at 10:20 am

Hi
That looks great, however, i am new to this, have bought thesis 1.6. I am not able to get those last 10 post’s show up as teasers. If you look at my front/Home page, that is what i really want my articles page to be like, and then add the option to have the users seach as those other options.
In advance thanks for comment on this one too.

Reply

Lee November 10, 2009 at 9:42 pm

Alex,

I am very impressed with your site. I hope to make my site as functional/usable as your someday. Nice tutorial!

Reply

Nezine December 22, 2009 at 1:16 pm

I am really loving your tutorials. As a programmer, I find it very interesting and come up with new ideas.

Hope to see more!

For Bloggers Who want to Stop Writers’ Block

Reply

Boni April 12, 2010 at 6:33 am

I found this tutorial is not working. I use thesis 1.7 and i found my website is look bad and give this message :
Parse error: syntax error, unexpected ‘}’ in C:\my XamPP\xampp\htdocs\localblog\wp-content\themes\thesis_17\custom\custom_functions.php on line 424

Reply

Willie Jackson April 12, 2010 at 4:28 pm

Just implemented this. Nice work my friend. Thanks!
Willie Jackson´s last blog ..We’ve got it all wrong

Reply

Benjamin August 8, 2010 at 11:46 pm

This works great on Thesis 1.8. Thank you very much for your contribution to the WP community. Its lovely!

Reply

Leave a Comment

CommentLuv Enabled

8 trackbacks