Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Custom post types - WordPress


Published on

Keith Devon gives a presentation to the WordPress London group about custom post types in WordPress.

For video and article, see

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

Custom post types - WordPress

  1. 1. Custom Post Types What, why and how
  2. 2. Keith Devon• Freelance web designer and WordPress developer• Specialise in building custom themes and plugins• Founder of WordPress London
  3. 3. What we’ll cover• What are Custom Post Types• When to use them• How to use them• Taking things further• Resources• Questions
  4. 4. What are they?Think content not posts. I.e. Custom Content Types
  5. 5. What are they? Examples:•Movies•Staff•Podcasts•Books•Products•Testimonials, etc, etc.
  6. 6. When to use them? An example: “I want to create a website for my holiday home rentals company. I have a portfolio of 20 properties that I want to be able to manage and update. Each property has the following information:”• Name• Price per week• Number of rooms• Short intro• Full property description• An image
  7. 7. Enter, custom post types• Cleaner UIs• Easier theme customisation• Easier to maintain and update your code
  8. 8. Registering your CPTYou can do this using plugins, but...
  9. 9. Registering your CPT
  10. 10. Template files• single-$posttype.php• archive-$posttype.php• Replace $posttype with the variable name of your CPT.• E.g. single-kdev_properties.php
  11. 11. Congratulations!You’ve created a custom post type.Now for even more awesomeness...
  12. 12. Custom meta boxes
  13. 13. Custom meta boxes• Show the code
  14. 14. • Show the meta box image
  15. 15. • Show the meta box image
  16. 16. Custom Taxonomies Hierarchical Not hierarchical(like categories) (like tags)
  17. 17. Resources meta boxes with WPAlchemy
  18. 18. Now you know:• What a custom post type is• When to use them• That it’s simple to implement• It makes your life easier!
  19. 19. Thanks for listening Any questions? @keithdevon
  20. 20. Follow ups• Slides will be posted on• Video (hopefully) will be posted• @wpldn #wpldn