Skip to content

How To Add Post Formats To Your WordPress Theme

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:

  1. Standard: Just a regular post without anything special.
  2. Aside: Similar to a Facebook update.
  3. Link: A link to an external website.
  4. Image: Just a simple image, nothing huge.
  5. Quote: A quotation.
  6. Status: A short status update, similar to a tweet.
  7. Video: A single video.
  8. Audio: An audio file.
  9. 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' );

Leave a Reply

Your email address will not be published. Required fields are marked *