Your SlideShare is downloading. ×
Custom post types - WordPress
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Custom post types - WordPress


Published on

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

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

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide
  • Pitched at beginner/intermediate devs\n\nSome knowledge of theme structure, some PHP\n
  • \n
  • \n
  • \n
  • \n
  • Before WP3 = hacking posts\nMessy code\nMessy admin area\n
  • CPTs make things easier for you and the client\n\nImproved workflow and productivity.\n
  • \n\n
  • Mention plugins and generators\n\nThis code is all we need to get this...\n\n
  • \n
  • Clean interface, nothing that we don’t need.\n
  • Need to add:\nPrice\nRooms\n
  • has_archive => true, if using an archive page\n
  • Remember rooms and price \n
  • Not just for CPTs.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. Custom Post Types What, why and how
    • 2. Keith Devon• Freelance web designer and WordPress developer• Specialise in building custom themes and plugins• Founder of WordPress London
    • 3. What we’ll cover• What are Custom Post Types• When to use them• How to use them• Taking things further• Resources• Questions
    • 4. What are they?Think content not posts. I.e. Custom Content Types
    • 5. What are they? Examples:•Movies•Staff•Podcasts•Books•Products•Testimonials, etc, etc.
    • 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. Enter, custom post types• Cleaner UIs• Easier theme customisation• Easier to maintain and update your code
    • 8. Registering your CPTYou can do this using plugins, but...
    • 9. Registering your CPT
    • 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. Congratulations!You’ve created a custom post type.Now for even more awesomeness...
    • 12. Custom meta boxes
    • 13. Custom meta boxes• Show the code
    • 14. • Show the meta box image
    • 15. • Show the meta box image
    • 16. Custom Taxonomies Hierarchical Not hierarchical(like categories) (like tags)
    • 17. Resources meta boxes with WPAlchemy
    • 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. Thanks for listening Any questions? @keithdevon
    • 20. Follow ups• Slides will be posted on• Video (hopefully) will be posted• @wpldn #wpldn