source: trunk/www.guidonia.net/wp/wp-content/themes/carrington-mobile-1.0.2/posts/README.txt@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 2.8 KB
Line 
1## posts/
2
3The files in this directory are "top level" templates for pages in WordPress that show multiple posts at once. These files should call `the_header()`, `the_sidebar()`, `the_footer()` and `cfct_loop()` to include the other parts of the page.
4
5The file from this directory that will be used is chosen based on the current page context.
6
7You can explicitly decide which _loop/_ to use from these templates by passing it in as so:
8
9 cfct_template_file('loop', 'example');
10
11which would use _loop/example.php_ for the loop.
12
13
14## General Context
15
16When choosing a template to use in the General Context, the Carrington engine looks at the type of request is being fulfilled. It will identify the request as the home page, a category archive, and individual post, etc.
17
18There is additional checking done for single post requests. All options in the Content Context are supported here with a 'single-' prefix added to the file. See specifics below.
19
20A "default" template is required, and will be used when there are no other templates that match a given comment. This could be because no other templates have been created, or because the comment in question doesn't match the templates that are available.
21
22By default, conditions are checked in this order:
23
241. author
252. role
263. category
274. tag
285. single
296. default (home, search, archivem 404, etc.)
30
31This can be altered using the `cfct_general_match_order` hook.
32
33
34### Supported Templates (General Context)
35
36- *{dirname}-default.php* (or default.php) - Used when there are no other templates that match for a given page/post.
37- *archive.php* - Used for date archives or if there are no specific category, author or tag templates.
38- *author.php* - Used for author archive lists.
39- *author-{username}.php* - Used when the post/page is authored by a specific user. For example, a template with a file name of _author-jsmith.php_ would be used for a post/page by user _jsmith_. Any WordPress username can take the place of {username} in the file name.
40- *category.php* - Used for category archive lists.
41- *cat-{slug}.php* - Used fr displaying 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 _cat-general.php_.
42- *home.php* - Used when on the home page.
43- *page.php* - Used for pages that do not match any other contextual templates.
44- *role-{rolename}.php
45- *search.php* - Used when displaying search results.
46- *single.php* - Used for single post pages.
47- *single-{content context filenames}.php* - Used for single post pages.
48- *tag.php* - Used for tag archive lists.
49- *tag-{slug}.php* - Used for displaying a given tag. The tag is matched by the "slug" - for example a post in tag "News" (with a tag slug of "news") could use a template of _tag-news.php_.
50
Note: See TracBrowser for help on using the repository browser.