Codex

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

Talk:Function Reference/get archives

Is one of the types for the get_archives() tag "categories"? It seems logical to be able to list get_archives(categories) or get_archives(categories=12). Did this get missed or is it under a different tag?

Lorelle 17:50, 4 Feb 2005 (GMT)

No, Lorelle, archives are purely date-based archives, like the NYTimes has an archives of their daily editions and so forth, so it is purely chronological. The category "archives" are addressed by other template tags

Carthik 22:15, 4 Feb 2005 (GMT)

A little more adavanced

Is there a way to stick some PHP into a get_archive?

What I'm trying to do is place an avatar next to the titles of each entry but it's not working out at all. This is what I have so far:

<?php get_archives('postbypost', '7', 'custom', '<img src="/images/authors/<?php the_author(); ?>.jpg" class="menu_author">', '<br>'); ?>

You can see how I'm trying to slip the author's name in there as a filename but it's actually printing the PHP code out on the page rather than working the way I want it to.