What Is Post Format? How to Use WordPress Post Formats Properly?

What Is Post Format? How to Use WordPress Post Formats Properly?

Post format is a kind of theme feature that was first introduced in WordPress 3.1 release. Usually, post formats can be added to posts to let themes display your posts in a different way. Also, they can be embedded to custom post types with another line of code.

In the following, we will show how to activate and use such a built-in feature inside WordPress theme. Note that, there are a number of different themes like Twenty Ten and Twenty Eleven coming pre-loaded with post formats, which is however beyond the scope of this tutorial.

What Are Post Formats? Why Use It?

As noted above, post formats are meta information used to style the visual presentation of a specific post. There are up to 9 supported post formats, including:

  • Video – A post containing videos or video playlists.
  • Audio – A single audio playlist or file. It may contain your favorite podcasts or tunes.
  • Status – A quick update for what you’re doing right now. This is very similar to Twitter status update.
  • Gallery – A gallery of pictures or images. Post may include a gallery short code, with image attachments included.
  • Chat – Chat transcripts that are used to highlight conversations between you and your friends, both on and off-line.
  • Aside – Brief snippets for post content, such as anecdotes and quick thoughts. It is quite similar to Facebook note update and styled without title.
  • Link – A single link to another website. It’s often used when you need to share an external link to a fantastic article with a couple of thoughts on it.
  • Quote – A single quotation that will highlight your text in a bold way. Sometimes, the quote may be the content, with the author or source being the title.
  • Image – A single image. The first tag with will be considered as image in the post. Alternatively, if the post only consists of a URL, then that will be the URL of image and the post title will be the image attribute.

What Are Post Formats

Though many post formats are available, it’s impossible for plugins or themes to introduce custom post formats. With the support of those formats, your blog will become more user-friendly and readers can understand what type of posts they are viewing with ease. Furthermore, your blog page will look lively with different style of posts applied. This feature helps organize and popularize a blog than standard categories and tags typically do.

How to Add & Designate Post Formats in WordPress?

Just like menus and post thumbnails, the post formats need to be enabled within the current WordPress theme. That is, this feature will be available only if they are compatible with your theme. Note that, this activation process requires a fair understanding of HTML/CSS code.

Fine Theme File

Enable Post Formats

As show, you should login to WordPress dashboard and navigate to the “Theme Functions” file normally located at “Appearance” > “Editor”. To enable “Post Formats” support in WordPress theme, just copy and paste the following line of code to this “functions.php” file.

add_theme_support( 'post-formats', array( 'aside', 'quote', 'video', 'image',  'link', 'gallery', 'audio' ) );

If successful, a new “Format” field will appear underneath your “Publish” bar. Depending on personal needs, this section varies from person to person. Upon writing a post, you can choose to use a preferred format before clicking the “Publish” button.

Example Post Formats

Style Your WordPress Post Formats

If you don’t customize the pre-styled post formats in advance, nothing will change even you select one format in WordPress post panel. To tell your theme how to display the content, you can use this has_post_format() conditional tag.

if ( has_post_format( 'aside' )) {
  // code to style aside format post
  } else if (has_post_format('link')) {
   // code to style link format post 
} else if (has_post_format('gallery')) {
   // code to style gallery format post
} else if (has_post_format('quote')) {
   // code to style quote format post 
   } else if (has_post_format('video')) {
   // code to style video format post 
}else {
   // Stuff to present the normal format post

How About WordPress Plugins for Post Formats?

Though it’s not hard to understand what post formats are, customizing them from a blank slate remains to be a knotty task for most WordPress beginners. That’s where post format plugins come in handy. In the following, there are several useful plugins that do all the heavy lifting for you automatically.

  • Post Format Widget – a simple plugin that lets you display a list of post formats in WordPress sidebar. It just works the same as the categories widget and gives the option to set custom widget title, modify tooltip text as well as show post format ID numbers.
  • Set Aside – a comprehensive plugin that makes it possible to change all the post formats in a category. If needed, you can choose to display just one type of post for readers, such as image, link and video, etc.
  • WP Post Formats – a handy plugin that empowers you to control what’s displayed inside the post formats, without the need to alter your theme code. It’s fully compatible with WordPress 3.1 or higher versions.
  • Post Format Permalink – a helpful plugin, with which you can include post format slug in the permalinks. Once activated, you only need to add %format% to custom permalink structure.