A Guide to WordPress Post Formats

Post formats are one of the most interesting additions to WordPress 3.1.

They enable us to apply different styling to a particular post type (e.g. page or post) by choosing from one of the types provided by WordPress itself:

  • aside –  A short piece of content, typically styled without a title.
  • gallery – A gallery of images.
  • link – A single link to another site.
  • image – A single image.
  • quote – A single quotation.
  • status – A short status update, similar to a Twitter status update.
  • video – A single video.
  • audio – A single audio file.
  • chat – A chat transcript.

How to add Post Format Support

Adding theme support for post formats is very easy, just paste the following into your functions.php file.

Of course, if you don’t require the full set of post formats, just omit the ones you don’t need from the array.

Now check out your post editor and you will see a new ‘Format’ box in the right hand side bar.

Displaying different Post Formats on your site

In order for your post formats to show up with their own structure and styling on the site, you need to modify your theme. Ideally you use something similar to this code:

WordPress will thus check if there are any post formats present, then load the appropriate template according to the format it finds.

Improvements

When Post Formats came out many people were asking why WordPress doesn’t have a customised UI for each Post Format (as is the case with the Tumblr service). This might well be the case in the future, but for now, the format is the same whatever Post Format you choose (Title and Post Editor). If you need a custom UI (especially if you are designing this for a client), the solution can be that of using Custom Meta Boxes. If you need to display different meta boxes for different post formats, a partial solution using JQuery can be found here.

At the moment it is not possible to add any custom post formats, although there is the possibility that the feature might be included in future releases.

If you enjoyed this post, make sure to subscribe to WPMayor’s RSS feed.

About Jean Galea

Jean Galea is a WordPress developer, entrepreneur and padel player. He is the founder of WP Mayor, the plugins WP RSS Aggregator and EDD Bookings, as well as the Mastermind.fm podcast. His personal blog can be found at jeangalea.com.

Related Articles

  • WordPress Post Formats Admin UI

    The use of Post Formats, introduced in WordPress 3.1, has had limited success and adoptability by WordPress users. With the introduction of this Admin UI for WordPress Post Formats, using…

  • WordPress is great for blogs, and of course commenting is an essential part of blogging. Your blog readers can post comments with HTML tags. For their convenience, you can display…

  • Custom Post Types and Custom Fields were the two features that really transformed WordPress from a simple blogging tool to a fully-fledged CMS. Many still think that custom post types…

Leave a Reply