Forum Moderators: open

Message Too Old, No Replies

WP: Archive, by Date, by Category. how?

         

httpwebwitch

2:51 pm on Sep 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I write articles about widgets, doodads, and gromits.

I am making heavy use of categories in my WP-powered site.
So I've ended up with some URLs like this:

http://www.example.com/category/widgets/
http://www.example.com/category/doodads/
http://www.example.com/category/gromits/

Now, I can get an archive of everything from July by visiting this:

http://www.example.com/2008/07/

But what I want is only the articles about doodads from July.
An archive, by date, by category.
Is there no pattern for that?

I might have expected something like this:

http://www.example.com/2008/07/widgets/
http://www.example.com/2008/07/doodads/
http://www.example.com/2008/07/gromits/

or maybe

http://www.example.com/category/widgets/2008/07/
http://www.example.com/category/doodads/2008/07/
http://www.example.com/category/gromits/2008/07/

but no dice.

I've found no mention of this sort of archiving in the codex, and I haven't yet encountered a plugin that solves the problem.

help!

Marcia

6:36 pm on Sep 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm hesitant to post because I don't *know* and can only take a stab in the dark about possibilities.

You can create custom templates for just about anything (without breaking anything), so my guess would be that creating a custom archives template could be a start:

[codex.wordpress.org...]

Those can be done from scratch or can just modify an existing template, done in a text editor and uploaded to the theme's content folder. So it might be possible to do by using the get_archives function on a custom archive page, if it takes arguments:

How to pass tag parameters [codex.wordpress.org]

Or the_category_rss [codex.wordpress.org] if it can be date delimited in some way.

ergophobe

1:25 pm on Sep 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Like Marcia, I don't know either, but you might have a look at
[codex.wordpress.org...]

Check out the last example in particular.

httpwebwitch

1:37 pm on Sep 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Marcia! I think that will work! You've saved me!

Of course now I have a pile of learning and coding to do... I was hoping for a plugin solution, but that's just because I'm lazy (in a good way)

thanks

Marcia

11:50 am on Sep 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are also conditional tags that can be used, which is probably a big help for customization opions when doing a custom template.

[codex.wordpress.org...]

How about sharing what you find to help us all out who are trying to figure these things out. Maybe even write a plugin when you get it mastered!

Marcia

9:22 am on Sep 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Simple Archive Generator [wordpress.org]

plug-in to generate a list (by category) of all posts

And they're listed chronologically within categories.

ergophobe

7:04 pm on Sep 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I saw that one, but couldn't figure out if creates separate pages by month for each category.

httpwebwitch

8:56 pm on Sep 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



all these are close, but not quite what is needed

I got started building something custom-made, but gave up after 2 hours when my head exploded in a flurry of gore leaving smears of grey matter sludge all over the screen

I'm positive I could build something like this from scratch, just using SQL to query the database... but I'd really like to do things "right" and work this out within the architecture of the WP codex. So far no luck.

ergophobe

9:11 pm on Sep 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm positive I could build something like this from scratch, just using SQL... but I'd really like to do things "right" and work this out within the architecture of the WP codex. So far no luck.

I know what you mean. I ran into something similar recently. It took me 15 minutes to whip up a snippet that did what I wanted to, but after several hours of trying to figure out how to do it within the drupal API, I decided I needed to move on to other things.

Doing things "right" can be so much simpler or so much harder depending on whether the API was designed to allow for what you want to do or not.

That's why I tell people that if you can hire a major contributor to whatever CMS you're working with (i.e. a developer who has contributed core code and complex plugins/modules), it's 5x the price of someone who is an excellent programmer but doesn't know the app. They just don't have to invest all that time in figuring out the "right" way to do it.

-------------------------
"OK. Let's just do this one more time using a method I like to call 'The Right Way'"
-- Rocketman (Disney? movie).