Beyond the Rhetoric

 

Creating a Kick Ass Archives Page

June 12th, 2007 by Michael Kwan

My journey to create an Archives page in Wordpress has been a lot more challenging than I had first anticipated. I’m far from being a PHP or HTML expert — though I know a couple of things — so I couldn’t understand why the N4R Most Commented Posts plug-in wouldn’t work within a Wordpress Page. Fumbling around Google, I discovered that I couldn’t use PHP call tags within a Page or a Post. Those could only be used within page templates like those used for your sidebar, header, and main page. This may sound obvious to some gurus out there, but it was news to me.

More fumbling around ensued. Spud Oregon of Nice4Rice told me that I had to create a new page template. I didn’t completely understand what that meant, but I proceeded anyways. I then asked John Chow for help and he said, “Wordpress makes the archives page for you.” He told me to go the “Write Page”, er, page and then go to the page template pull-down from the right side. I told him it wasn’t there. He figured that whoever designed my Wordpress theme forgot to include it. I furled my eyebrows in confusion and disgust.

I eventually came across this page that taught me how to create an Archive page. Finally! In a nutshell, what I did was create a copy of the page.php file found within my Wordpress theme, rename this new file page-archive.php, and insert some code in there to make the magic happen. Basically, you leave the header, footer, and sidebar stuff alone within the page-archive.php file, but you plunk in the PHP stuff you want in the “content” portion. Suddenly, the page template pull-down that John was describing appeared before me.

Success! Awesome! I got the N4R Most Commented Posts plug-in to work! Now that I created a proper Archives page, I suddenly felt that just the monthly links were insufficient and that’s when I found the Smart Archives plug-in by Justin Blanton. You can see this archive system — which links to every year, every month, and every post you’ve ever written — in action through the link above. On a related note, I have now removed the monthly links from the sidebar as they have now become obsolete. The category listings (previously called “tags”) are still there though.

The downside to all of this work is that I got very little paid work done today. You know, the stuff associated with my freelance writing business. At least I finally got this monkey off my back.

Filed under Stuff.

   Subscribe via RSS Feed.  Free Email Updates.

Related Reading:

  • USB TV Tuner Contest Update
  • InvestorBlogger Blogs About Investing
  • Roy Says It’s Sleepy Time
  • Keep Marketing Away From the Manuals
  • Demystifying the Work From Home Phenomenon
  • 11 Responses to “Creating a Kick Ass Archives Page”

    1. mark says:

      @Michael: I’m glad Search-This could help you with the Archives page. Perhaps we earned a spot in your blogroll? :) Don’t be a stranger to Search-This, there’s plenty more good info where that came from!

      cheers,
      mark

    2. Spud Oregon says:

      Great to see you got your archives page together. That smart archives plug-in looks good. I might have to try that for myself. Oh, and thanks for using the most commented posts plug-in! :)

    3. Kumiko says:

      Great page. Going to have to do this myself.

    4. Definitely will do this too, great idea Michael

    5. archshrk says:

      Glad you got it figured out. As for the problem you mentioned on my post about archives, it looks like you forgot to remove one of the tags from the original page.php but your new archives seems to work.

      I use the narchives (linked in my post) for the search engines but my official archives page uses Live Archives.

    6. Vijay says:

      I use SRG clean archives from geekwithlaptop.. I did try using Justin Blanton’s one but unfortunately I ran into problems and I went with this one instead.

    7. Gregg says:

      I feel your pain; my wife and I took the plunge to getting our own domain and migrating from Blogger to Wordpress as our blogs are starting to gain popularity and we needed to do it sooner than later. I’ve been living HTML and PHP for the past week.

    8. Roberta says:

      I may have to pick this up for review on earsucker….sounds pretty nifty.

    9. Matt says:

      Looks pretty cool.

      It’d be even cooler if it was divided into monthly pages and used AJAX to go to the next page without refreshing the whole page.

    10. Hi, there!..bd97293b6d1ec7595e7312bc9599b5f7