Permalink
Browse files

update docs to match new code features (formats, taxonomies, feeds

  • Loading branch information...
1 parent 61d9ac7 commit 0107cf9b2cfb744d2f7eeb41a6137493311783a2 @alexkingorg alexkingorg committed Dec 21, 2011
Showing with 13 additions and 6 deletions.
  1. +13 −6 _data/context-post.txt
View
@@ -13,12 +13,14 @@ The order in which these conditions are checked defaults to the following:
1. author
2. meta
-3. category
-4. type
-5. role
-6. tag
-7. parent
-8. default
+3. format
+4. category
+5. taxonomy
+6. type
+7. role
+8. tag
+9. parent
+10. default
however this order can be overridden with a plugin using the `cfct_single_match_order` hook.
@@ -29,11 +31,16 @@ Once a template match has been found, no other processing is done.
- *{dirname}-default.php* - Used when there are no other templates that match for a given post/page.
- *author-{username}.php* - Used when a user with that username authors a post/page. For example, a template with a file name of <code>author-jsmith.php</code> would be used for a poat/page by user <code>jsmith</code>. Any WordPres username can take the place of {username} in the file name.
+- *format-{slug}.php* - Used when a post has a given format. The format is matched by the "slug" - the lowercase version of the string in this situation ("video", "status", "link", etc.). Your theme must enable post formats to use this feature.
- *cat-{slug}.php* - Used when a post is in a given category. The category is matched by the "slug" - for example a post in category "General" (with a category slug of "general") could use a template of <code>cat-general.php</code>.
+- *tax-{taxonomy-slug}.php* - Used when a post has any term in a given custom taxonomy. The taxonomy type is matched by the "slug" - for example a custom taxonomy of "Colors" (with a slug of "colors") could use a template of <code>tax-colors.php</code>.
+- *tax-{taxonomy-slug}-{taxonomy-term-slug}.php* - Used when a post has a specific term in a given custom taxonomy. The taxonomy term is matched by the "slug" - for example a custom taxonomy of "Colors" with a term of "Red" (with a slug of "colors" and "red" respectively) could use a template of <code>tax-colors-red.php</code>.
- *type-{post_type}.php* - Used when a post belongs to a specific custom post type. The type is matched by the "post_type" property of the post. For example if you had a custom post type of <code>news</code>, you could use a template with the name <code>type-news.php</code>.
- *meta-{key}.php* - Used when there is a custom field for the post/page matching the key listed in the file name. This is useful if you want to be able to flag posts as "photo" or similar, and give those posts some custom treatment. In this example, you could add a custom field of "photo" with a value of the URL of the image to a post/page and it would use a template of <code>meta-photo.php</code> if that template exists. The value does not matter in this match.
- *meta-{key}-{value}.php* - Used when there is a custom field for the post/page matching the key and value listed in the file name. This is useful if you want to be able to flag posts as "featured" or similar, and give those posts some custom treatment. In this example, you could add a custom field of "featured" with a value of "yes" to a post/page and it would use a template of <code>meta-featured-yes.php</code> if that template exists.
- *page.php* - Used when the content is being displayed is a page (not a post).
- *parent-{slug}.php* - Used when a page is a child page of a specific parent page. The page is matched by the "slug" - for example a page under a parent page with slug of "example" could use a template of <code>parent-example.php</code>.
- *role-{role}.php* - Used when a post/page is authored by a user with a particular role. The {role} is an all lowercase representation of the role string - for example, an author with an "Administrator" role might use a template of <code>role-administrator.php</code>. This is primarily useful if you have a set of authors that are given a Contributor role; or a Guest Columnist role or similar. Any WordPress role can take the place of {role} in the file name.
- *tag-{slug}.php* - Used when a post has a certain tag applied to it. The tag is matched by the "slug" - for example a post with tag "Reference" (with a tag slug of "reference") could use a template of <code>tag-reference.php</code>.
+
+If you wish to customize the output displayed in your feeds, you can create templates using the naming conventions above and prefix them with "feed-". These will only take effect in your feeds.

0 comments on commit 0107cf9

Please sign in to comment.