
Something not often understood in WordPress is the difference between Post Formats and Post Types. There are 5 page types built into WordPress: Post, Page, Attachment, Revision and Nav Menu. Since the release of 3.1 you can now add custom types, but we'll go over that in another tutorial. This tutorial is going to show you how post formats work: There are 9 default post formats. A post format, is used to arrange content inside a post type. A post format is a specific html and css layout for showing some standardized content: aside, gallery, link, image, quote, status, video, audio, and chat. Even though you will see these listed on your post creation page, they may not be active in your theme. To get full use of them you need to activate them by adding a line of code. 1. Edit your functions.php file![]() You'll need to download this file and open it in an editor, or you can use your control panel file manager to open and edit it. BEST PRACTICE: make a copy of it and name it something like, functionsORIGINAL.php or whatever you need to so you can find it if you need to quickly recover a working copy by renaming the original back to it's original name. 2. Open the file in a text editor and scroll to the bottom![]() You could put it at the top, or in the middle, but I find it's easier to do this at the bottom of the file. You will need to insert a line of code here. In this illustration you would insert it in line 4550. I also like to insert a comment so I know what I did and when I did it in case I come back later and have to change things. /* Add support for custom post formats - August 2, 2011 by Ed*/ 3. Save the file and upload it to the server, overwriting the old one.![]() When you're done, it should look similar to the picture above, with the line of code inserted before the closing bracket "}" and the php closing mark "?>" A comment is a line in the file that won't be used by the program. Starting the line with /* and ending it with */ will "comment out" the line. (In yellow in the illustration.) Before you upload it, did you make a backup copy of the original? If you get any error messages, restore the original so your site won't be down while you figure it out. Example: Sample Post with Standard Format applied![]() In the standard format, you can see the Headline, and the Posted on date and the balloon in the upper right. This is what a post looks like in Theme 2011. After adding the line of code to functions.php, you get additional choices. Example: Here's the story with the "Status" format applied.![]() After checking the "Status" check box on the editing page the post now displays without the headline and date, and adds the member's avatar. Example: Aside format![]() WordPress supports the following post formats. These formats cannot be changed by the average user and are meant to be standards of typical formats.
|

All of our tutorials are published under the Creative Commons Attribution-NonCommercial license. This means:
Copyright 2013 Open Source Training, LLC. All rights reserved.
Comments
Kind regards,
Nick