Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Talk:Creating an Archive Index

Hi Yami,

Thanks for the good work :)

It will be great if the points in the support forums posts could be summarized or written up clearly here. Please let me know when you are done creating this page, and we will move it in someplace suitable.

Carthik 19:54, 28 Feb 2005 (UTC)

I've been poking around this fascinating article and I have a few editing questions, Yami.

  • In the first sentence you talk about the WordPress Default template. Do you mean the WordPress Default Theme? Important difference and we're trying to clean up terminology around here lately. Getting out the broom!
  • "To set up a separate archive index in a way that plays with the Version 1.5 theme system" doesn't really clarify what the article is about, so can we reword it to something like, "Taking advantage of the WordPress v1.5 Theme system of modular template files, we can set up a separate archive index [or template file] to create our own customized archive list." I'm sure you can say it better.
  • In the next section, you talk about what is possible to do instead of getting on and telling us what you are going to "tell us about". Can we reword this so we get to the heart of the matter and then add the possibilities later. I know you are talking about another method, cumbersome at that, of creating an archives page, but we need the meat right up front. You have such good info and tips, let's get to them. Something like "Begin with a simple template called X"...and give them a suggestion on a name and then add "you can call it anything, though WordPress reserves some names for special features." This way it is short and gets to the point without all the "standard name" justification.
  • I might be missing the point here, but it needs to be explained why this is so swell when there is already an archives page - why create a Page for that? At the beginning should be some hypothetical description of the benefits of doing this. Like adding customize text, pictures, or whatever to make it look "different", or having a different sidebar or header or stylesheet. Something that helps people understand why they would do this.

This is all minor stuff that I brutalize all new articles with. It's a really good article and much needed. Just a little fleshing out. Instead of making these changes and fixes myself, I thought I'd give you the chance to pick and choose how to go about this so it fits in.

EXCELLENT WORK! Lorelle 05:10, 24 Mar 2005 (UTC)


Thanks Lorelle! All spot-on suggestions. Please don't hesistate to edit this yourself if you feel like it, as I'm not sure when I'll next have time to seriously polish - but it's on my list, for sure.

As to why it's swell - when you say "there's already an archives page", are you talking about the archive list included in the sidebar? Or the, e.g., monthly/category archives? The archives.php template included in Kubrick? Or something else that I'm not aware of?

When I first downloaded WordPress I saw a template file called archives.php and had no clue how to use it, which was my motivation for writing this... if it turns out that there was something else there all along, and I was just blind, well, it wouldn't be the first time I missed something obvious :)

yami 16:29, 24 Mar 2005 (UTC)

Don't worry, I did some slash and burn on this and will when it is closer to really ready. I must not have been clear about explaining myself. There must be a purpose behind the article. Something like "So, you want your archives to look totally and completely different from the default archive - this is what you do" or "Want to have only certain categories showing in your archives page, you can customize it this way to do....", just something at the beginning of the article that says "here is why you should waste your time and energy to do this really cool thing".
I'm not arguing with you, just trying to get the best article out of you. So if you say "I saw a template file called archives and wanted to figure out how it worked" then the article is about how the file works. If you saw it, hated it and had a good reason for wanting something different, then it helps the reader to understand that there is a greater goal here than using the one that came with the car.
As for the rest of the edit comments, I felt they were discretionary enough that it should be up to you to decide how you want to word it since I'm unfamiliar with the process. Other than understanding exactly why this is a good thing to do, it can stand on its own except for the minor details. Honestly, good work. And we need more like this!
Lorelle 22:56, 24 Mar 2005 (UTC)

Oh, I didn't mean to sound so defensive! I just felt we might've been talking past one another, mostly because the word "archives" can be used for so many different things.

Anyway. I've punched it up a lil', let me know if the introduction and overall goal make more sense now. And where should this go? I originally concieved of it as part of a larger guide to transitioning from Movable Type, but I really don't have time to write up the overarching guide right now...

yami 04:31, 4 Apr 2005 (UTC)

Brilliant, Yami. I adore the introduction. Better than anything I could have come up with. Absolutely wonderful!
As to where to put it, I'll ask on the wp-docs mailing list for you, but I think this would be great under the new Lessons section we are starting which gives how-to, step-by-step instructions on different aspects of using WordPress. They may have other ideas, but either way, this is great and I'm anxious to get it out there. Thanks so much for the hard work on it! Lorelle 21:27, 4 Apr 2005 (UTC)

Thanks for the instructions on this, I followed the directions and it worked, although the theme I'm using kind of messed up the placement of the id=content from the archives.php page. As it turns out, you end up with two divs called 'content' and when 'content' in the theme is already styled by the theme's css, it may not work out so well when you try to apply a theme to the archives.php page. This is easily fixed by replicating the 'content' id in your css and renaming it to something else, and then making the adjustments in that div id's style in the theme's stylesheet. Once I renamed it in archives.php, it worked great and was properly placed on the page.

I'd like to take this archives.php page a bit further, though. Since php is capable of doing some pretty powerful stuff with regards to page rendering times, I'd like to make this archives.php page into a full and complete index of everything on the wordpress installation: each blog post in each category, plus a listing of pages and subpages. Only problem is, I am a total newb with php and can't quite figure out how to write the code to do that.

You'd end up with:

Pages

>> list of each page (linked)

>>> list of subpages (linked)

Year

Monthly Archives for that Year

>> months listed here

Category Name (linked to category)

>> linked post titles

> subCategory Name (linked to subcategory)

>>>> linked post titles

Can anyone help me figure out how to do that?

Aine 08:59, 10 May 2005 (UTC)

Aine, thank you for the helpful information. It helps to know that our work is helping others. As for your specific question, the Codex is a documentation site and doesn't provide support. Please post your question on the WordPress Forum. Also, what you want to do is called a "site map" and there are many ways of creating these. There is a lot of info on the forums about that and we will soon have an article here on how to create a site map for your site. Lorelle 22:08, 10 May 2005 (UTC)
Some of this could go in as sample code, though; the template section is a little light on detail.
Aine, if you solve your problem, feel free to come back and add the "magic bullet" of code that solves your archive display problem - either for category or monthly archives - as an example in the templates section.
yami 04:05, 13 May 2005 (UTC)