Codex tools: Log in
Languages: English • 日本語 • Português do Brasil • Русский • 中文(简体) • (Add your language)
Post Formats is a theme feature introduced with Version 3.1. A Post Format is a piece of meta information that can be used by a theme to customize its presentation of a post. The Post Formats feature provides a standardized list of formats that are available to all themes that support the feature. Themes are not required to support every format on the list. New formats cannot be introduced by themes nor even plugins. The standardization of this list provides both compatibility between numerous themes and an avenue for external blogging tools to access to this feature in a consistent fashion.
In short, with a theme that supports Post Formats, a blogger can change how each post looks by choosing a Post Format from a radio-button list.
Using Asides as an example, in the past, a category called Asides was created, and posts were assigned that category, and then displayed differently based on styling rules from post_class() or from in_category('asides'). With Post Formats, the new approach allows a theme to define a Post Format (e.g. add_theme_support('post-formats', array('aside'))), and then the post format can be selected in the Publish meta box when saving the post. A function call of get_post_format( $post->ID ) can be used to determine the format, and post_class() will also create the "format-asides" class, for pure-css styling.
The following Post Formats are available for users to choose from, if the theme enables support for them.
Note that while the actual post content entry won't change, the theme can use this user choice to display the post differently based on the format chosen. For example, a theme could leave off the display of the title for a "Status" post. How things are displayed is entirely up to the theme, but here are some general guidelines.
John: foo Mary: bar John: foo 2
Note: When writing or editing a Post, Standard is used to designate that no Post Format is specified. Also if a format is specified that is invalid then standard (no format) will be used.
Os seguinte artigos estão disponíveis em inglês somente: