Adding Post Format Support for a Theme

Since WordPress 3.1, users are able to take advantage of a new function that allows users to assign some specific post format for their posts. These particular feature could be really useful for people who wants to customize the look and feel of their certain post format. A post assigned “gallery” format should be different from “standard” post format and that’s exactly what this new function does.

Default WP themes and many third party themes already uses this feature. However, if you want to enable this feature for your custom made theme, this is what you should do.

<?php add_theme_support('post-formats', array('aside','gallery')); ?>

Simply copy and paste this snippet on your current theme’s functions.php page and update it. From now on, you theme should support both the “aside” and “gallery” post format. Let’s not forget WordPress added few more post format for your convenience. Use the documentation link provided below and get the most out of your theme.

Reference: post_formats

Today In History

  •  
  •  

Comment

Leave a Reply

Note: Convet HTML, PHP, JavaScripts from Postable, before posting from comment section.
License: By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution. Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.