Add post formats support

  1.  
<?php add_theme_support( 'post-formats', array( 'status', 'gallery' ) ); ?>

Instructions:

WordPress Post Formats was introduced in WP 3.1 and let’s you define a format for your posts to display them differently according to what one that was chosen.

There are ten different formats you can choose from, and you can decide witch ones you want to support.

To check whether a post has a format or not, you can use this conditional tag:

if ( has_post_format( 'status' )):
  echo 'this is the status format';
endif;

You can also add the Format functionality to pages, or your own custom post type:

add_post_type_support( 'page', 'post-formats' ); // add to pages
add_post_type_support( 'books', 'post-formats' ); // add to custom post type books

Related links:
http://codex.wordpress.org/Post_Formats
Share this snippet

If you like this snippet, share it with friends!