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

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 7.5 KB
Line 
1# Carrington CMS Theme Framework for WordPress
2http://carringtontheme.com
3
4by Crowd Favorite
5http://crowdfavorite.com
6
7Released under the GPL license
8http://www.opensource.org/licenses/gpl-license.php
9
10---
11
12## What is Carrington?
13
141. A collection of elegant, high-end WordPress themes for end-users.
152. A designer and developer friendly CMS theme framework for WordPress.
163. A set of best practices for theme organization.
17
18
19## Basic Framework Concept
20
21Carrington is a CMS theme framework that virtually eliminates the need for custom conditional code in themes. Instead, template naming conventions along with the Carrington engine replace the need for this conditional code.
22
23Theme functionality is broken up into thoughtfully crafted abstractions to enable customizations at different levels (the loop, the post/page content, comments, etc.) and the Carrington engine chooses which template to be used for each segment of the theme.
24
25The abstractions and supported template types are designed to easily handle most of the customization scenarios we commonly see without the need to write custom code to use them.
26
27
28## Context and Templates
29
30WordPress provides a number of functions to help you determine what type of view a theme is showing. These include:
31
32- `is_home()`
33- `is_single()`
34- `is_page()`
35- `is_archive()`
36- `in_category()`
37- etc.
38
39Carrington abstracts these to deduce a "context" that is used when selecting a template. There are three context types used by the Carrington framework:
40
411. Comment (dirs: comment)
422. Post (dirs: content, excerpt)
433. General (dirs: attachment, comments, footer, header, loop, posts, sidebar, single)
44
45Each directory implements one of these contexts for selecting the appropriate template to use. Templates are used in page views based on how they match the given context(s) for the overall page and the specific pieces of content being displayed.
46
47Read about the options available in each directory in the README file for that directory.
48
49Note: "default.php" is a supported default file name for all directories, however we have found in real world usage that {dirname}-default.php is a preferable naming system. When you have a half-dozen "default.php" files open in your favorite text editor, telling them apart in the file list can be more difficult than it should be.
50
51
52## Theme Organization
53
54WordPress themes generally have a file structure similar to this:
55
56- 404.php
57- archive.php
58- archives.php
59- [...]
60- sidebar.php
61- single.php
62- style.css
63
64While this organization works well in many instances, it doesn't well support the concept of atomic elements that are combined to create a theme. For example, a representation of just a post's content, or just a comment, is not represented here.
65
66Carrington respects the supported WordPress file naming conventions (for example `get_header()` will still work), but eschews them in favor of an organizational structure that better suits the abstraction and customization commonly needed for a WordPress theme.
67
68Template files are layered into each other using the following basic approach:
69
701. top level templates that include
712. common elements like a header, footer and sidebar along with a
723. loop that includes
734. atomic post/page content or excerpt templates and, where appropriate, a
745. comments area template that includes
756. atomic template for comments and a
767. template for the comment form
77
78
79## Actions and Filters
80
81The Carrington core is a theme framework, not a parent/child theme system. It includes a core set of functions that enable the override template hierarchy. These functions include actions and filters where appropriate so that their functionality can be customized and overridden as needed. These actions and filters use the same hook and filter system used in the WordPress core.
82
83
84### Filters
85
86- `cfct_context` - allows you to apply filters to the return value of the `cfct_context()` function; the function that checks to see what posts file, loop file, etc. to show.
87- `cfct_filename` - filter the output of the `cfct_filename()` function.
88- `cfct_general_match_order` - set the order in which general templates are chosen (make it check for a cat-general template ahead of a cat-news template, etc.).
89- `cfct_choose_general_template` - filter the output of the `cfct_choose_general_template()` function (the selected general template).
90- `cfct_single_match_order` - set the order in which single and content templates are chosen (make it check for author templates ahead of meta template, etc.).
91- `cfct_choose_single_template` - filter the output of the `cfct_choose_single_template()` function (the selected single template).
92- `cfct_choose_content_template` - filter the output of the `cfct_choose_content_template()` function (the selected content template).
93- `cfct_comment_match_order` - set the order in which content templates are chosen (make it check for role templates ahead of user templates, etc.).
94- `cfct_choose_comment_template` - filter the output of the `cfct_choose_comment_template()` function (the selected comment template).
95- `cfct_meta_templates` - filter the return value of the `cfct_meta_templates()` function (change the list of files returned).
96- `cfct_cat_templates` - filter the return value of the `cfct_cat_templates()` function (change the list of files returned).
97- `cfct_tag_templates` - filter the return value of the `cfct_tag_templates()` function (change the list of files returned).
98- `cfct_author_templates` - filter the return value of the `cfct_author_templates()` function (change the list of files returned).
99- `cfct_role_templates` - filter the return value of the `cfct_role_templates()` function (change the list of files returned).
100- `cfct_parent_templates` - filter the return value of the `cfct_role_templates()` function (change the list of files returned).
101- `cfct_single_templates` - filter the return value of the `cfct_parent_templates()` function (change the list of files returned).
102- `cfct_comment_templates` - filter the return value of the `cfct_single_templates()` function (change the list of files returned).
103`cfct_post_gallery_columns` - set the number of columns to show in the gallery.
104`gallery_style` - retained from the WP function code copied in and altered for gallery display.
105`cfct_option_defaults` - allows you to set defaults (alter/add/etc.) for Carrington options.
106
107
108### Actions
109
110- `cfct_settings_form` - allows you to add your own fields to the Carrington Settings form (left for compatibility` - recommend using _top and _bottom as needed instead of this).
111- `cfct_settings_form_top` - allows you to add your own fields at the top of the Carrington Settings form.
112- `cfct_settings_form_bottom` - allows you to add your own fields at the bottom of the Carrington Settings form.
113- `cfct_settings_form_after` - allows you to add your content after the Carrington Settings form. Useful if you want to add a second form to the page, or some other content.
114- `cfct_update_settings` - allows you to take action when the Carrington settings are being saved (perhaps to also save fields you've added in the `cfct_settings_form` action).
115
116
117## Plugins
118
119Any .php files in the *plugins/* directory will be automatically loaded by Carrington. This is a great way to bundle in custom functions or to hook into Carrington's actions or filters and be able to distribute everything as a single theme package.
120
121---
122
123## Tips
124
125There is very minor extra processing associated with the file system and context checks that Carrington requires. This overhead is virtually unnoticeable, however the use of a caching plugin is recommended as a general best practice.
Note: See TracBrowser for help on using the repository browser.