A powerpoint that explains the new post type format feature in WordPress.
Text of Post Type Formats
1. POST FORMATS By Megan Goodson
2. WHAT ARE THEY? Post formats are a theme feature that came out in WordPress 3.1that allow a user to format each post differently based on the type ofcontent. They are like Tumblrs post formats on their blogging interface. 3. HOW TO FIND THEM To find them, log into your WP Dashboard and go to Posts, AddNew. If they are supported and enabled in your theme you will see alittle box that looks like this: 4. USING POST FORMATS You have to put this code into your themes function.php to enable support for PostFormats. If you are using WordPresss theme Twenty Eleven its already there. But if you wantto add in the rest of the post formats you have to edit it. 5. LIST OF POST FORMATS Image Standard Link Video Aside Audio Chat Status Gallery Quote 6. NOTICE You can NOT make your own post types. You can only use the ones that come with the theme. You CAN edit the styles of the post types. Not all themes can support post types. (Example: Hybrid does not.) 7. POST FORMATS: ASIDE An aside is usually a short entry and is published without a title. 8. POST FORMATS: AUDIO An audio format is meant for a single audio clip or a song. 9. POST FORMATS: CHAT A chat format is supposed to be for a few lines of a chat from aninstant message session with a friend or a family member (or anyone). 10. POST FORMATS: GALLERY This format is for a collection of images using a gallery format. 11. POST FORMATS: LINK A post that holds a single link. 12. POST FORMATS: QUOTE These posts are great just for putting an inspirational quote down. 13. POST FORMATS: STANDARD This is the standard WordPress post type. 14. POST FORMATS: STATUS This post type sort of resembles a Facebook status post. 15. POST FORMATS: VIDEO This post type is meant for posting a video clip. 16. STYLING YOUR POST FORMATSWhat, you thought they came styled? Thats way too easy! 17. YO U A R E U S I N G T H E M BU T T H E Y L O O KHORRIBLEIck this isnt that appealing. 18. LETS STYLE OUR OWN I played around with the PHP and styles and here is one I came up with.Remember:You can only *style* the formats, you can NOT make up your own post formats yet. 19. HOW DID I DO IT? Its basically the same structure every time. There are a few basic classes you have to edit in the template fileand sometimes rearrange a couple of divs (and delete elements youdont want) and finally maybe a couple of tweaks to the functions.phpfile. I will get into more detail in the next few slides. 20. ORIGINAL CODE 21. W H A T W E WA N T T O W O R RY A B O U T 22. CHANGING CODEThis line right here gives theentire post its class. So I namedmine aside_containerThe updated line should look likethis, given of course your class willbe your name and not mine 23. CHANGING CODE After you edit that, the rest of the divs are simple. For every entry-classname you see just replace it with thepostypename-classname. Example: entry-content will now be aside-content NOTE: only change element classes on the elements you want tochange. If you only want to style the header then just change theentry-header. Otherwise you will have to remember to style them all. 24. EXAMPLE Change to: aside-titleChange to: aside-format and I went ahead and changed the string after that as well. But youwould change this to whatever format you are using (i.e link, gallery, etc) Change to: aside-summary Change to: aside-contentChange to: aside-meta 25. FINAL CODE 26. ASIDE TEMPLATE STYLED 27. STYLING LINK FORMAT This is going to be the same process as the aside format. The only real difference is in the styling. REMEMBER Only change the classes you want to style or needto style. Compare your content-link.php to content-aside.php and try tomatch up everything. 28. C O N T E N T- L I N K . P H P C O D E 29. LINK FORMAT STYLED 30. STYLING VIDEO FORMAT Styling the video format can be either easy or complicated it justdepends what kind of styling you want. For example purposes I am going to make it as simple as possible. However, online there are many articles on how to style videoformats, so if you want to go further, I suggest you go online and seewhat is out there. 31. NOTICE Twenty Eleven does NOT have a content-video.php template. So we have to make one. Its not very hard all you need to do is duplicate one of thetemplates. I duplicated the links template. Then all you do is change everything once again to video-elementname. 32. VIDEO TEMPLATE CODE 33. VIDEO FORMAT STYLED 34. EDITING PHP So far weve been editing just the HTML around the code with one ortwo tweaks to the php code but nothing too drastic. Were about to dive in to the drastic editing. Two things to remember: *****ALWAYS MAKE A BACK UP OF YOUR FILES ***** DO NOT edit this if you dont want to. This is just personaltaste. 35. MISSING A COMMENT LINK? Im sure youve all noticed this one chunk of code that has beencommented out. I did it on purpose because I didnt feel like we needed twocomment links. 36. THE CHUNK OF CODE Commenting it out, I got rid of the reply bubble and I left the leave a reply. I didnt delete it just incase I decided that I wanted it later. 37. R E A R R A N G I N G M E TA DATA To customize this further I also decided that I wanted to changeup the date and the reply link. In my code I found the PHP the codeand played around with it. I personally just deleted mine because I knew for certain that Idefinitely did not want it back. 38. ORIGINAL CODEThe arrows above are what we are going to edit.1. The class sep just means separator. Its what separates the comments link from the date. So DELETE that line to get rid of the separator.2. I changed the leave a reply to just reply you can put anything you want in between the for the comment link to say whatever you want. (It could say to the Batcave)3. The last line is the edit post link. I personally thought it was in the way, so I deleted that line as well. 39. NEW CODEAbove is the new code and it makes the layout look a bit better forwhat I was going for. 40. WHAT ABOUT THEOTHERS? The other post type formats can be edited the same way. There needs to be a template.php file for each format you want toedit/change. There is ***NO*** styling on the original format types. So if youwant it to look different you HAVE to edit it. 41. CONCLUSION Post Formats are fun! You can NOT create your own at the moment (this could very welland probably will change with one of the newest updates) You CAN only STYLE the formats as we did in the slides before. Have fun and make your WordPress more to your taste!