Custom Post Types in Depth at WordCamp Montreal

Joey Kudish
Joey KudishCode Wrangler at Automattic
WordPress Custom Post Types In-Depth
    Colin Vernon & Joachim Kudish
Organizing Content of
Different Types

•   It’s about Content: websites usually have
    content of different types: posts, pages,
    articles, videos, newsletters, products,
    books, anything

•   A question of content and information
    architecture
    vs data structure
Back in the day...

 •   Websites were simpler... ?

 •   Created custom architecture with pages

 •   Different content types could be “faked” with
     categories and category navigation
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
What are custom post
types?


•   Introduced in WordPress 2.9, much
    simplified in 3.0 and expanded upon in 3.1

•   Classic blog format used categories to
    classify content

•   Custom post types allow for more in-depth
    fine-grained control and separation of
    content

•   Better name = custom content type
Advanced uses of CPTs



•   Products (WP E-Commerce uses it -
    http://getshopped.org/)

•   Job Postings

•   Testimonials

•   Newsletters

•   Possibilities are endless!
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
Registering Custom Post
Types
 Graphical/easy way:

  •   Plug and play, simple interfaces

  •   Custom Post Type UI - http://
      wordpress.org/extend/plugins/custom-
      post-type-ui/

  •   GD Custom Posts And Taxonomies Tools
      - http://wordpress.org/extend/plugins/
      gd-taxonomies-tools/

  •   More Types - http://wordpress.org/
      extend/plugins/more-types/

  •   Lots of other examples
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
GRAPHICAL


  ≠
   USER
INTERFACE
Code Method



 register_post_type();

  •   http://codex.wordpress.org/
      Function_Reference/register_post_type

  •   core function

  •   lots of $args for lots of possibilities
http://pastie.org/2169751 (taken from the WP Codex)
$args = customization
Admin:

 •   labels, show_ui, show_in_menu,
     menu_position, menu_icon,
     capability_type, capabilities,
     map_meta_cap, register_meta_box_cb,
     can_export, show_in_nav_menus

Front-end:

 •   public, publicly_queryable,
     exclude_from_search, hierarchical,
     taxonomies

Permalinks:
Code = Good ☺


•   versionable (svn, git, etc...)

•   core WordPress way

•   easy to edit at any time

•   you keep full control

•   similar to what GUI plugins do,
    but without relying on the database

•   only a few lines of code
Some Shortcomings of
WP API



 •   lots of repetition in the code

 •   not good enough defaults (labels!)

 •   now has good support for archives (since
     3.1) but still no built-in support for feed
     permalinks, etc.
Alternate Code Methods
•   Smarter Custom Post Types by Matt Wiebe:


    •   http://somadesign.ca/projects/smarter-
        custom-post-types/

    •   now obsolete because of 3.1’s archive/
        permalinks abilities

•   Our own SLD Custom Content & Taxonomy

    •   https://github.com/jkudish/SLD-
        Custom-Post-Types-Taxonomies-for-
        Wordpress

    •   wrapper plugin/class for
Taking CPTs even
further
•   Taxonomies

    •   further way of classifying content

    •   group different content types together
        based on taxonomies

    •   use built-in taxonomies (categories &
        tags) or custom taxonomies

    •   register custom taxonomies with code,
        not GUI plugins

    •   use the core WP function
        register_taxonomy()
        http://codex.wordpress.org/
        Function_Reference/register_taxonomy
Custom Post Types in Depth at WordCamp Montreal
http://pastie.org/2170028
Taking CPTs even
further

•   Meta fields / meta boxes / custom fields:

    •   allow you to store any information

    •   extremely expandable

    •   WordPress API requires a lot of code, no
        good defaults:

        •   add_meta_box()

        •   http://codex.wordpress.org/
            Function_Reference/add_meta_box
Custom Post Types in Depth at WordCamp Montreal
Meta Boxes
•   similarly to content types & taxonomies,
    there are GUI plugins to register meta
    boxes

    •   More Fields: http://wordpress.org/
        extend/plugins/more-fields/

    •   Advanced Custom Fields: http://
        wordpress.org/extend/plugins/
        advanced-custom-fields/

    •   Verve Meta Boxes: http://
        wordpress.org/extend/plugins/verve-
        meta-boxes/
Easier Meta Fields


 •   Custom Metadata Manager by Mohammad
     Jangda

 •   http://wordpress.org/extend/plugins/
     custom-metadata/

 •   easy wrapper functions for adding meta
     boxes and custom fields
Custom Metadata
Manager
x_add_metadata_field(
 $slug,
 $object_types = 'post',
 $args = array()
 )
x_add_metadata_group(
 $slug,
 $object_types = 'post',
 $args = array()
 )
Even Further...
•   complex post to post (content to content)
    relations

    •   allows web app functionality à la Rails/
        Django

    •   posts 2 posts plugin: http://
        wordpress.org/extend/plugins/posts-to-
        posts/

•   different page/content templates = different
    set of fields
✔ Lessons Learned

•   use custom content types for anything that
    isn’t a blog post and isn’t a static page

•   if you’re a developer, don’t rely on the
    database to register CPTs

•   if you’re not a developer, hire a developer,
    learn to code (copy/paste) or use a plugin

•   best way to learn = read the codex, code and
    make mistakes
Extra links


 •   Custom post type & custom taxonomy
     generator: http://themergency.com/
     generators/

 •   Joachim’s WP.org profile page (the SLD
     helper class plugin will appear here once it’s
     live): http://profiles.wordpress.org/users/
     jkudish

 •   Colin’s WP.org profile page: http://
     profiles.wordpress.org/users/cvernon

 •   WordPress.tv (recorded presentation will
     appear here): http://wordpress.tv/
Thanks!
Any Questions?
Thanks!
       Any Questions?




http://stresslim.it/welovewp


@stresslimit /   http://stresslimitdesign.com

@jkudish /   http://jkudish.com
Thanks!
Any Questions?
1 of 34

Recommended

Becoming a better WordPress Developer by
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress DeveloperJoey Kudish
1.6K views40 slides
The Way to Theme Enlightenment by
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme EnlightenmentAmanda Giles
1.6K views49 slides
Creating Customizable Widgets for Unpredictable Needs by
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsAmanda Giles
695 views26 slides
Shortcodes vs Widgets: Which one and how? by
Shortcodes vs Widgets: Which one and how?Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Amanda Giles
3.4K views27 slides
WordPress Theme Development: Part 2 by
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2Josh Lee
649 views20 slides
doing_it_right() with WordPress by
doing_it_right() with WordPressdoing_it_right() with WordPress
doing_it_right() with WordPressryanduff
605 views18 slides

More Related Content

What's hot

Custom WordPress theme development by
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme developmentTammy Hart
9.8K views56 slides
WordPress theme development from scratch : ICT MeetUp 2013 Nepal by
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalChandra Prakash Thapa
18.4K views54 slides
Introduction to Plugin Programming, WordCamp Miami 2011 by
Introduction to Plugin Programming, WordCamp Miami 2011Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011David Carr
1.5K views39 slides
Extending WordPress by
Extending WordPressExtending WordPress
Extending WordPressJonathan Bossenger
1.2K views23 slides
Custom Fields & Custom Metaboxes Overview by
Custom Fields & Custom Metaboxes OverviewCustom Fields & Custom Metaboxes Overview
Custom Fields & Custom Metaboxes OverviewEast Bay WordPress Meetup
1.2K views28 slides
How to start developing apps for Firefox OS by
How to start developing apps for Firefox OSHow to start developing apps for Firefox OS
How to start developing apps for Firefox OSbenko
5.9K views29 slides

What's hot(20)

Custom WordPress theme development by Tammy Hart
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
Tammy Hart9.8K views
WordPress theme development from scratch : ICT MeetUp 2013 Nepal by Chandra Prakash Thapa
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
Chandra Prakash Thapa18.4K views
Introduction to Plugin Programming, WordCamp Miami 2011 by David Carr
Introduction to Plugin Programming, WordCamp Miami 2011Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011
David Carr1.5K views
How to start developing apps for Firefox OS by benko
How to start developing apps for Firefox OSHow to start developing apps for Firefox OS
How to start developing apps for Firefox OS
benko5.9K views
Intro to WordPress theme development by Thad Allender
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme development
Thad Allender30.1K views
The Way to Theme Enlightenment 2017 by Amanda Giles
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
Amanda Giles505 views
Put a little Backbone in your WordPress by adamsilverstein
Put a little Backbone in your WordPressPut a little Backbone in your WordPress
Put a little Backbone in your WordPress
adamsilverstein2.5K views
Introduction to Custom WordPress Themeing by Jamie Schmid
Introduction to Custom WordPress ThemeingIntroduction to Custom WordPress Themeing
Introduction to Custom WordPress Themeing
Jamie Schmid460 views
Advanced WordPress Development Environments by Beau Lebens
Advanced WordPress Development EnvironmentsAdvanced WordPress Development Environments
Advanced WordPress Development Environments
Beau Lebens2.4K views
WordPress Theme Development for Designers by elliotjaystocks
WordPress Theme Development for DesignersWordPress Theme Development for Designers
WordPress Theme Development for Designers
elliotjaystocks1.8K views
WordPress Theme Structure by keithdevon
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structure
keithdevon4.3K views
Javascript for the c# developer by Salvatore Fazio
Javascript for the c# developerJavascript for the c# developer
Javascript for the c# developer
Salvatore Fazio3.8K views
WordPress as the Backbone(.js) by Beau Lebens
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
Beau Lebens4.9K views
OpenERP and Perl by OpusVL
OpenERP and PerlOpenERP and Perl
OpenERP and Perl
OpusVL1.5K views

Viewers also liked

Workshop 4: IJssel-Vechtdelta lessons learned by
Workshop 4: IJssel-Vechtdelta lessons learnedWorkshop 4: IJssel-Vechtdelta lessons learned
Workshop 4: IJssel-Vechtdelta lessons learnedBas van Dishoeck
548 views16 slides
Custom Post Types and Taxonomies by
Custom Post Types and TaxonomiesCustom Post Types and Taxonomies
Custom Post Types and TaxonomiesTammy Hart
3.6K views31 slides
WordPress 3 Custom Post Types by
WordPress 3 Custom Post TypesWordPress 3 Custom Post Types
WordPress 3 Custom Post TypesDave Zille
1.9K views78 slides
Step by step guide for creating wordpress plugin by
Step by step guide for creating wordpress pluginStep by step guide for creating wordpress plugin
Step by step guide for creating wordpress pluginMainak Goswami
14.9K views3 slides
Anatomy and Architecture of a WordPress Theme by
Anatomy and Architecture of a WordPress ThemeAnatomy and Architecture of a WordPress Theme
Anatomy and Architecture of a WordPress ThemeJulie Kuehl
3K views17 slides
Architecture for WordPress on AWS by
Architecture for WordPress on AWSArchitecture for WordPress on AWS
Architecture for WordPress on AWSSaravana Kumar Periyasamy
1.9K views1 slide

Viewers also liked(10)

Workshop 4: IJssel-Vechtdelta lessons learned by Bas van Dishoeck
Workshop 4: IJssel-Vechtdelta lessons learnedWorkshop 4: IJssel-Vechtdelta lessons learned
Workshop 4: IJssel-Vechtdelta lessons learned
Bas van Dishoeck548 views
Custom Post Types and Taxonomies by Tammy Hart
Custom Post Types and TaxonomiesCustom Post Types and Taxonomies
Custom Post Types and Taxonomies
Tammy Hart3.6K views
WordPress 3 Custom Post Types by Dave Zille
WordPress 3 Custom Post TypesWordPress 3 Custom Post Types
WordPress 3 Custom Post Types
Dave Zille1.9K views
Step by step guide for creating wordpress plugin by Mainak Goswami
Step by step guide for creating wordpress pluginStep by step guide for creating wordpress plugin
Step by step guide for creating wordpress plugin
Mainak Goswami14.9K views
Anatomy and Architecture of a WordPress Theme by Julie Kuehl
Anatomy and Architecture of a WordPress ThemeAnatomy and Architecture of a WordPress Theme
Anatomy and Architecture of a WordPress Theme
Julie Kuehl3K views
WordPress Code Architecture by Mario Peshev
WordPress Code ArchitectureWordPress Code Architecture
WordPress Code Architecture
Mario Peshev9.2K views
WordCamp Ireland - 40 tips for WordPress Optimization by Joost de Valk
WordCamp Ireland - 40 tips for WordPress OptimizationWordCamp Ireland - 40 tips for WordPress Optimization
WordCamp Ireland - 40 tips for WordPress Optimization
Joost de Valk3.1K views
Beginning WordPress Plugin Development by Aizat Faiz
Beginning WordPress Plugin DevelopmentBeginning WordPress Plugin Development
Beginning WordPress Plugin Development
Aizat Faiz6.7K views
Wordpress Plugin Development Short Tutorial by Christos Zigkolis
Wordpress Plugin Development Short TutorialWordpress Plugin Development Short Tutorial
Wordpress Plugin Development Short Tutorial
Christos Zigkolis11.4K views

Similar to Custom Post Types in Depth at WordCamp Montreal

WordPress can do that?! by
WordPress can do that?!WordPress can do that?!
WordPress can do that?!Scott McNulty
979 views77 slides
WordPress - Open Source Overview Presentation by
WordPress - Open Source Overview PresentationWordPress - Open Source Overview Presentation
WordPress - Open Source Overview PresentationAndy Stratton
1.7K views56 slides
WordPress Complete Tutorial by
WordPress Complete TutorialWordPress Complete Tutorial
WordPress Complete TutorialOpenSource Technologies Pvt. Ltd.
17.9K views186 slides
The Flexibility of WordPress by
The Flexibility of WordPressThe Flexibility of WordPress
The Flexibility of WordPressStephanie Eckles
1.2K views15 slides
The WordPress University 2012 by
The WordPress University 2012The WordPress University 2012
The WordPress University 2012Stephanie Leary
5K views121 slides
The WordPress University by
The WordPress UniversityThe WordPress University
The WordPress UniversityStephanie Leary
22.1K views105 slides

Similar to Custom Post Types in Depth at WordCamp Montreal(20)

WordPress - Open Source Overview Presentation by Andy Stratton
WordPress - Open Source Overview PresentationWordPress - Open Source Overview Presentation
WordPress - Open Source Overview Presentation
Andy Stratton1.7K views
Starting WordPress Theme Review by Catch Themes
Starting WordPress Theme ReviewStarting WordPress Theme Review
Starting WordPress Theme Review
Catch Themes7.2K views
PluginBasicsWCNYC2014 by Kiko Doran
PluginBasicsWCNYC2014PluginBasicsWCNYC2014
PluginBasicsWCNYC2014
Kiko Doran3K views
WordPress A CMS for Beginners, Geeks and Those In-Between by Heidi Cool
WordPress A CMS for Beginners, Geeks and Those In-BetweenWordPress A CMS for Beginners, Geeks and Those In-Between
WordPress A CMS for Beginners, Geeks and Those In-Between
Heidi Cool2.2K views
WordPress Theme Reviewers Team by Mario Peshev
WordPress Theme Reviewers TeamWordPress Theme Reviewers Team
WordPress Theme Reviewers Team
Mario Peshev1.3K views

Recently uploaded

Igniting Next Level Productivity with AI-Infused Data Integration Workflows by
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Safe Software
280 views86 slides
Piloting & Scaling Successfully With Microsoft Viva by
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft VivaRichard Harbridge
12 views160 slides
Evolving the Network Automation Journey from Python to Platforms by
Evolving the Network Automation Journey from Python to PlatformsEvolving the Network Automation Journey from Python to Platforms
Evolving the Network Automation Journey from Python to PlatformsNetwork Automation Forum
13 views21 slides
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...Jasper Oosterveld
19 views49 slides
PharoJS - Zürich Smalltalk Group Meetup November 2023 by
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023Noury Bouraqadi
132 views17 slides
MVP and prioritization.pdf by
MVP and prioritization.pdfMVP and prioritization.pdf
MVP and prioritization.pdfrahuldharwal141
31 views8 slides

Recently uploaded(20)

Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software280 views
Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi132 views
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman36 views
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf by Dr. Jimmy Schwarzkopf
STKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdfSTKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdf
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf
Future of AR - Facebook Presentation by ssuserb54b561
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
ssuserb54b56115 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson92 views
SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
Case Study Copenhagen Energy and Business Central.pdf by Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana16 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2218 views

Custom Post Types in Depth at WordCamp Montreal

  • 1. WordPress Custom Post Types In-Depth Colin Vernon & Joachim Kudish
  • 2. Organizing Content of Different Types • It’s about Content: websites usually have content of different types: posts, pages, articles, videos, newsletters, products, books, anything • A question of content and information architecture vs data structure
  • 3. Back in the day... • Websites were simpler... ? • Created custom architecture with pages • Different content types could be “faked” with categories and category navigation
  • 6. What are custom post types? • Introduced in WordPress 2.9, much simplified in 3.0 and expanded upon in 3.1 • Classic blog format used categories to classify content • Custom post types allow for more in-depth fine-grained control and separation of content • Better name = custom content type
  • 7. Advanced uses of CPTs • Products (WP E-Commerce uses it - http://getshopped.org/) • Job Postings • Testimonials • Newsletters • Possibilities are endless!
  • 10. Registering Custom Post Types Graphical/easy way: • Plug and play, simple interfaces • Custom Post Type UI - http:// wordpress.org/extend/plugins/custom- post-type-ui/ • GD Custom Posts And Taxonomies Tools - http://wordpress.org/extend/plugins/ gd-taxonomies-tools/ • More Types - http://wordpress.org/ extend/plugins/more-types/ • Lots of other examples
  • 14. GRAPHICAL ≠ USER INTERFACE
  • 15. Code Method register_post_type(); • http://codex.wordpress.org/ Function_Reference/register_post_type • core function • lots of $args for lots of possibilities
  • 17. $args = customization Admin: • labels, show_ui, show_in_menu, menu_position, menu_icon, capability_type, capabilities, map_meta_cap, register_meta_box_cb, can_export, show_in_nav_menus Front-end: • public, publicly_queryable, exclude_from_search, hierarchical, taxonomies Permalinks:
  • 18. Code = Good ☺ • versionable (svn, git, etc...) • core WordPress way • easy to edit at any time • you keep full control • similar to what GUI plugins do, but without relying on the database • only a few lines of code
  • 19. Some Shortcomings of WP API • lots of repetition in the code • not good enough defaults (labels!) • now has good support for archives (since 3.1) but still no built-in support for feed permalinks, etc.
  • 20. Alternate Code Methods • Smarter Custom Post Types by Matt Wiebe: • http://somadesign.ca/projects/smarter- custom-post-types/ • now obsolete because of 3.1’s archive/ permalinks abilities • Our own SLD Custom Content & Taxonomy • https://github.com/jkudish/SLD- Custom-Post-Types-Taxonomies-for- Wordpress • wrapper plugin/class for
  • 21. Taking CPTs even further • Taxonomies • further way of classifying content • group different content types together based on taxonomies • use built-in taxonomies (categories & tags) or custom taxonomies • register custom taxonomies with code, not GUI plugins • use the core WP function register_taxonomy() http://codex.wordpress.org/ Function_Reference/register_taxonomy
  • 24. Taking CPTs even further • Meta fields / meta boxes / custom fields: • allow you to store any information • extremely expandable • WordPress API requires a lot of code, no good defaults: • add_meta_box() • http://codex.wordpress.org/ Function_Reference/add_meta_box
  • 26. Meta Boxes • similarly to content types & taxonomies, there are GUI plugins to register meta boxes • More Fields: http://wordpress.org/ extend/plugins/more-fields/ • Advanced Custom Fields: http:// wordpress.org/extend/plugins/ advanced-custom-fields/ • Verve Meta Boxes: http:// wordpress.org/extend/plugins/verve- meta-boxes/
  • 27. Easier Meta Fields • Custom Metadata Manager by Mohammad Jangda • http://wordpress.org/extend/plugins/ custom-metadata/ • easy wrapper functions for adding meta boxes and custom fields
  • 28. Custom Metadata Manager x_add_metadata_field( $slug, $object_types = 'post', $args = array() ) x_add_metadata_group( $slug, $object_types = 'post', $args = array() )
  • 29. Even Further... • complex post to post (content to content) relations • allows web app functionality à la Rails/ Django • posts 2 posts plugin: http:// wordpress.org/extend/plugins/posts-to- posts/ • different page/content templates = different set of fields
  • 30. ✔ Lessons Learned • use custom content types for anything that isn’t a blog post and isn’t a static page • if you’re a developer, don’t rely on the database to register CPTs • if you’re not a developer, hire a developer, learn to code (copy/paste) or use a plugin • best way to learn = read the codex, code and make mistakes
  • 31. Extra links • Custom post type & custom taxonomy generator: http://themergency.com/ generators/ • Joachim’s WP.org profile page (the SLD helper class plugin will appear here once it’s live): http://profiles.wordpress.org/users/ jkudish • Colin’s WP.org profile page: http:// profiles.wordpress.org/users/cvernon • WordPress.tv (recorded presentation will appear here): http://wordpress.tv/
  • 33. Thanks! Any Questions? http://stresslim.it/welovewp @stresslimit / http://stresslimitdesign.com @jkudish / http://jkudish.com

Editor's Notes

  1. both\n
  2. colin\n
  3. colin\n
  4. colin\n
  5. colin\n
  6. joey\n
  7. joey\n
  8. joey\n
  9. joey\n
  10. colin\n
  11. colin\n
  12. colin\n
  13. colin\n
  14. colin\n
  15. joey\n
  16. joey\n
  17. joey\n
  18. joey\n
  19. colin\n
  20. colin\n
  21. joey\n
  22. joey\n
  23. joey\n
  24. colin\n
  25. colin\n
  26. colin\n
  27. colin\n
  28. colin\n
  29. colin\n
  30. joey\n
  31. \n
  32. both\n
  33. both\n
  34. both\n
  35. both\n