Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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

taxonomy-post_format-post-format-link.php

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
add comment

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
1  
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
add comment

Your Answer

 
discard

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.