wordpress custom post types
TRANSCRIPT
![Page 1: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/1.jpg)
![Page 2: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/2.jpg)
WordPress CustomizationGoal: Gain a basic understanding of some common functions used by Clique from the WordPress PHP API, modifying the administrator user-interface, and present various data formats.
Outcomes:1. An understanding of what Post Types and Custom Fields are.2. Be able to identify when to use Custom Post Types and Custom Fields.3. Able to create and modify Custom Post Types and Custom Fields.
![Page 3: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/3.jpg)
Custom Post TypesOutcomes:
1. Create two Custom Post Types using the WordPress API2. Modify an existing Custom Post Type3. Be able query and display post information within page templates4. Acknowledge when to use Custom Post Types in different situations
![Page 4: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/4.jpg)
Custom FieldsOutcomes:
1. Create custom fields for different post types2. Gain an understanding of how to save, update, and delete custom post data3. Acknowledge when to use Custom Fields in different situations
![Page 5: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/5.jpg)
Agenda1. Why we use various post types. 2. How do I use this in my work, best practices3. Client example, adding post type to Kendall College site. 4. Adding post type to your forked site
![Page 6: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/6.jpg)
Understanding WhyWhy is it important to know how to create Custom Post Types and Fields - especially programmatically?
1. Present similar data in different ways2. Present different data in similar ways3. “Administrative Organization” - a well-organized user and programming
interface.
![Page 7: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/7.jpg)
Why - Second City
● Large and complex website● Must present varying data types in
varying formats● Each “post” has multiple, varying
pieces of metadata attached to it● Data types required their own unique
categorization system
![Page 8: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/8.jpg)
Why - Hampel & Co.
● Content isn’t updated regularly● Data has similar format, but needed
to be presented in different ways● Each “post” has a wide range of
varying metadata in different formats
![Page 9: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/9.jpg)
Planning• Create Post Types
– Identify “groups” of data and information• What content blocks are similar?• What content blocks are different?
• Create Custom Fields– Identify data/information that should be attached to post as metadata
Best Practices/Example
![Page 10: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/10.jpg)
![Page 11: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/11.jpg)
Building• Required hooks
– add_action• init• save_post
• Create Post Types– register_post_type
• Create Custom Fields– add_meta_box
Best Practices/Example
![Page 12: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/12.jpg)
![Page 13: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/13.jpg)
![Page 14: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/14.jpg)
Testing• Ensure post appears in back-end of WordPress
• Ensure data is being saved appropriately
• Loop through custom posts and fields on a page
Best Practices/Example
![Page 15: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/15.jpg)
You do● Programmatically add 3 custom post
types to your own personal sites● Programmatically add 3 custom fields
to your own personal sites
![Page 16: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/16.jpg)
ResourcesPost Type
● https://codex.wordpress.org/Post_Types● http://www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-
wordpress/Fields
● https://codex.wordpress.org/Custom_Fields● http://www.wpbeginner.com/wp-tutorials/wordpress-custom-fields-101-tips-tricks-
and-hacks/
● https://generatewp.com/
![Page 17: Wordpress Custom Post Types](https://reader035.vdocuments.net/reader035/viewer/2022070518/58e7f9cc1a28abf13f8b508b/html5/thumbnails/17.jpg)