Post Formats feature was introduced with the 3.1 release of WordPress. It’s a meta info that can be used to customize the post structure of the theme. It’s similar to Tumblr’s post format feature. You can also use post formats to specify a custom post temple for the format. We will talk about it later, but in this post we will only learn how to add post formats to your WordPress theme.
You can add post formats to your theme, even if your theme doesn’t support any of it. New formats cannot be introduced by themes or even plugins. WordPress supports following ten post formats:
- Standard: Just a regular post without anything special.
- Aside: Similar to a Facebook update.
- Link: A link to an external website.
- Image: Just a simple image, nothing huge.
- Quote: A quotation.
- Status: A short status update, similar to a tweet.
- Video: A single video.
- Audio: An audio file.
- Chat: Transcript of a chat or a chatbox using plugins.
Add Post Formats To Your Theme
Just add following snippet to your theme’s functions.php file:
add_theme_support( 'post-formats', array( 'aside', 'chat','gallery','image','link', 'quote', 'status', 'video', 'audio' ) );
You can also add post format support to Page and custom post types:
// add post-formats to post_type 'page'
add_post_type_support( 'page', 'post-formats' );
// add post-formats to post_type 'my_custom_post_type'
add_post_type_support( 'my_custom_post_type', 'post-formats' );