Your SlideShare is downloading. ×
0
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in WordPress
Custom Post Types in 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 in WordPress

1,422

Published on

My presentation for WordCamp New Zealand

My presentation for WordCamp New Zealand

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,422
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide



  • Talking about namespacing and writing good code









  • even more technical





  • Transcript

    • 1. Custom Post Types Anthony Cole, WordCamp New Zealand
    • 2. Welcome @anthonycole on twitter WordCamp Australia February 2011 - Come Along
    • 3. Today A note on coding standards Defining “Post Types” or “Content Types” Give an example of Custom Post Types Open up to questions about Custom Post Types
    • 4. Coding Standards Coding standards are very very important If you’re releasing a public plugin, things can go wrong if you don’t use namespaces The biggest problem with the plugin repository is a lack of following coding standards Version control. Version control is important (<3 git)
    • 5. Namespacing Prepend function names with something - anything! For example, an events plugin - could use evnt_show_events instead of just show_events This is good - you avoid conflicts! show_events is bad
    • 6. Write good code Brace Style Single-line conditionals http://codex.wordpress.org/ WordPress_Coding_Standards
    • 7. Bad
    • 8. Good
    • 9. Content Types WordPress can handle any type of content Content Types allow you to manage your data Optimised for limitless amounts of data - example, WP.com Defaults: Revisions, Posts, Pages
    • 10. “Custom” Post Types Wrapped around your content - it makes managing things easier Moulded to your data - Events, books, cars, anything Increase Productivity
    • 11. Example - Registration
    • 12. Example - Calling a Post Type
    • 13. Custom Post Types UI
    • 14. Getting technical Use register_post_type in an init hook Remember, namespacing Attributes - labels, supports metaboxes You can use single-type.php (single-event.php) URL routes (so /event/)
    • 15. Even More Technical Utilise taxonomies - you can tack on categories or any other taxonomy to a post type Post Types Manager Threading
    • 16. Examples Basic- UNSW Hothouse - Basic events Technical - WordPress.com css revisions Uses revisions Theme: Estate by WooThemes
    • 17. UNSW Hothouse
    • 18. More Info http:// codex.wordpress.org/ Custom_Post_Types http:// codex.wordpress.org/ Function_Reference/ register_post_type
    • 19. Question Time Ask me anything!

    ×