WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What should I call the archive file for a post format? Ex archive-gallery.php? (doesn't work)

I would like to create a list of all the gallery formats with a preview and some custom taxonomies thrown in.

share|improve this question
up vote 4 down vote accepted

Well.... for querying, formats are a taxonomy parameter...so that should work.... http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters

Lemme loook...

And yep, here's how that works http://codex.wordpress.org/Template_Hierarchy#Custom_Taxonomies_display


share|improve this answer
Thanks @Rev. Voodoo ... that should be listed in the Post Format Codex somewhere. :) – mattrepublic Jun 10 '11 at 19:58
Probably a good idea. I guess there isn't really anything there letting you know that a post format is handled as a taxonomy.... The codex is open for anyone to edit (maybe I'll do it, if my writing skills are decent!) – Rev. Voodoo Jun 13 '11 at 11:18

You don't need to create a custom template for the archive index for Post Format types. Your existing template files (taxonomy.php, archive.php, or index.php) will display them just fine.

Just use the following URL structure: www.example.com/type/{format}/, which for galleries, would be www.example.com/type/gallery/.

See here for a thorough explanation.

share|improve this answer
archive-postformat does not work so I assume it should be archive-post-format.php. I'll have to try that. Thanks! – mattrepublic Jun 10 '11 at 19:59
If you want to create a custom template file, the name would be taxonomy_post_format-post-format-{type}.php, which, for Galleries, would be taxonomy_post_format-post-format-gallery.php. But, again: I think using such custom template files is overkill. – Chip Bennett Jun 10 '11 at 20:49
Ahh I was had a - where I needed a _ :) – mattrepublic Jun 10 '11 at 21:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.