SlideShare a Scribd company logo
Custom Post Types
F o r m o r e s t r u c t u r e d c o n t e n t i n W o r d P r e s s
Introduction
Custom post types allow you to make WordPress a much more flexible and feature
rich content management system. In this meetup we’ll discuss how to setup,
customize, organize and implement multiple custom post types into your website or
project, and then connect them together to handle different types of content in a more
structured and effective way.
3
What We’ll (try) to Cover
Here’s a quick rundown of what I hope we can talk about in the time we have
• The basics: What is a custom post type?
• WordPress default Post types
• Why would you need a custom post type for your site?
• Examples of custom post types and where they are
used
• How to create a custom post types and taxonomies for
your site
• How to display your custom post types in your theme
• How and Why to connect multiple custom post types
together
• Code samples and how to use them in your theme
• Custom post types resources and links to get started or
learn more
• Q & A
4
What is a custom post type?
Custom post types extend wordpress to add functionality beyond the default post types
A custom post type is just a “post” with a different “post_type”
value saved in the database.
• WordPress added custom post types to the core in version 3.0.
• Standard posts (blog posts) have a post type of “post”.
• Standard Pages have a post type of “page”.
• Your custom post type can be whatever you want
• For example: “Staff”, “Portfolio”, etc…
• Custom post types show up as separate menu items
• Can have their own categories and tags (taxonomies) and can act
like a post or a page
• Can have all, some or none of the standard features
• Can use custom loops to call this content anywhere in your theme
5
Default WordPress Post Types
Here’s what you get out of the box
Posts (Post Type: 'post')1
Pages (Post Type: ‘page')2
Navigation Menus (Post Type: 'nav_menu_item')3
Attachments (Post Type: ‘attachment')4
Revision (Post Type: ‘revision')5
6
Why would you need a custom post type?
Why go through the trouble of using custom post types at all?
Flexible Content Management
Custom Data Fields
Better Content Structure
Be Searchable
If your content needs to be displayed differently than a standard post or page you
can create custom page layouts for each content type (i.e., unique layout)1
If you need more fields to manage all the information for a specific type of content
on your website (i.e., house amenities, car features, etc)2
If you want your content to have it’s own unique URL (permalink) structure separate
from posts and pages. For example “www.mydomain.com/staff/jimmy-john/”3
To more easily manage your content in the WordPress admin. Each custom post
type has it’s own tab and edit screens to keep things organized4
7
Post Type Example
North Okaloosa Physicians Group – Physicians Custom Post Type Archive Listing (template-physicians.php)
Here we used a custom post type “Physician” to
organize and display all the physicians in a
custom designed archive or “list” page
Custom Archive Page
Custom Query & Loop to display
Custom Page Template
Custom Search Based On Post Type
Can expand the content in the future
8
Post Type Example
North Okaloosa Physicians Group – Physicians Custom Post Type Detail Page (single-physician.php)
Custom post type “Physician” single page. Each
physician has a detailed bio page. Which also
brings in data from connected “specialties”
Custom Detail Page
Custom Query & Loop to display
Unique Layout Display
Custom Meta Fields
Easily edited should info change
9
Post Type Example
North Okaloosa Physicians Group – Physicians Custom Post Type Edit Screen
Custom “Physician” edit screen in WP admin has
multiple custom fields and meta boxes to
complete a detailed profile of each physician.
Custom Edit Screen
Custom Meta Boxes and Data Fields
Connected “Specialty” post type
Custom Taxonomy
Easily Expand Data Fields & connections
How do you
add a CPT?
Now let’s looks at the code and plugins
that allow you to add your own custom
post types (CPT) and custom
taxonomies
11
Create Custom Post Types
Custom post types should ideally be placed in a plugin, but they don’t have to be
1. Use a custom plugin to hold your post type code 2. Use plugins to manage and create your post types
Using a Custom
Plugin
Code your own plugin to handle your
custom post types and taxonomonies so
you can reuse it elsewhere or easily
change your theme.
13
Creating a Basic Plugin
Create a file called posttypes.php and add this code
14
Creating a Basic Custom Post Type
Minimal code to register a custom post type
15
Creating Advanced Custom Post Types
Complete code to register a custom post type
16
Creating a Custom Taxonomy
Code to register a custom taxomony
Using Existing
Plugins
Using existing, supported and frequently
updated plugins is a good way to
manage your custom post types and
custom fields
18
Custom Post Type UI – Post Type
Super easy to create post types and taxonomies
19
Custom Post Type UI -Taxonomy
Super easy to create post types and taxonomies
20
Display Post Types In Your Theme
Code to display a custom post type
21
Connecting Post Types Together
Use a plugin to associate post types together to create a relationship
22
Connecting Post Types Together
create a relationship – Add the PHP and get the connections meta box on your post types
23
Connecting Post Types Together
Display connected posts in theme template file with PHP
24
Connecting Post Types Together
Display connected posts with the provided P2P widget
25
Custom Post Type Resources
Links and additional resources if you want to go deeper into it
WordPress Codex CPT https://codex.wordpress.org/Post_Types
Custom Post Type UI Plugin
https://wordpress.org/plugins/custom-post-type-ui/
Advanced Custom Fields
https://wordpress.org/plugins/advanced-custom-fields/
Smashing Magazine Custom Post Type Article (2015)
http://www.smashingmagazine.com/2015/04/extending-wordpress-custom-content-
types/
Design Wall Custom Post Type Article (2014)
http://www.designwall.com/blog/use-custom-post-types-taxonomies-make-wordpress-
even-useful/
WordPress custom posts types for structured content
Thanks for Watching
Do you have any questions or awesomeness you’d like to share?
www.firestormcs.com cecil@firestormcs.com @firestormcs /FirestormCreativeStudios
Stay in touch:

More Related Content

Similar to WordPress custom posts types for structured content (20)

PDF
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Evan Mullins
 
KEY
Custom post types - WordPress
keithdevon
 
PDF
Custom content types & custom taxonomies in wordpress
stimasoft
 
PDF
Add Custom Post Types to Your WordPress Website
Dustin Hartzler
 
PDF
WordPress Custom Post Types
Nile Flores
 
PPT
An Introduction to Custom Post Types
Carleton Web Services
 
PPTX
WP 101 - Custom Fields & Post Types
Joe Querin
 
PPTX
WordCamp Kent 2019 - WP 101: Custom Post Type & Custom Fields
Joe Querin
 
PDF
Stepping Into Custom Post Types
K.Adam White
 
PPTX
Custom Post Types - WordPress
Jared Atchison
 
KEY
WordPress 3 Custom Post Types
Dave Zille
 
KEY
Custom Post Types in Depth at WordCamp Montreal
Joey Kudish
 
PPTX
Organizing Content with Custom Post Types and Taxonomies
Ryan Holmes
 
PPTX
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015
Joe Querin
 
PDF
WordPress Custom Post Type
KanaliTlt
 
PDF
WordPress Development - Custom Post Types
Juan Pablo De la torre Valdez
 
KEY
Using Custom Post Types & Taxonomies in WordPress
daelanw
 
PDF
Using Custom Post Types and Advanced Custom Fields with Elementor
Angela Bowman
 
PPTX
Custom WordPress theme development
Tammy Hart
 
PDF
Custom Post Type and Taxonomies in WordPress 3.x
Amit Kumar Singh
 
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Evan Mullins
 
Custom post types - WordPress
keithdevon
 
Custom content types & custom taxonomies in wordpress
stimasoft
 
Add Custom Post Types to Your WordPress Website
Dustin Hartzler
 
WordPress Custom Post Types
Nile Flores
 
An Introduction to Custom Post Types
Carleton Web Services
 
WP 101 - Custom Fields & Post Types
Joe Querin
 
WordCamp Kent 2019 - WP 101: Custom Post Type & Custom Fields
Joe Querin
 
Stepping Into Custom Post Types
K.Adam White
 
Custom Post Types - WordPress
Jared Atchison
 
WordPress 3 Custom Post Types
Dave Zille
 
Custom Post Types in Depth at WordCamp Montreal
Joey Kudish
 
Organizing Content with Custom Post Types and Taxonomies
Ryan Holmes
 
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015
Joe Querin
 
WordPress Custom Post Type
KanaliTlt
 
WordPress Development - Custom Post Types
Juan Pablo De la torre Valdez
 
Using Custom Post Types & Taxonomies in WordPress
daelanw
 
Using Custom Post Types and Advanced Custom Fields with Elementor
Angela Bowman
 
Custom WordPress theme development
Tammy Hart
 
Custom Post Type and Taxonomies in WordPress 3.x
Amit Kumar Singh
 

Recently uploaded (20)

PPT
Marketing Mix - Mrs.S.Shree Nithi - BBA-02.07.2025.ppt
shreenithis2
 
PDF
KFC Brand Audit and Marketing Strategies
ASHITHA P R
 
PPTX
Tesla_Motor Company Marketing_Strategy.pptx
obotecollince
 
PPTX
SEO Solutions Boosting Growth | TechCadd
radhikachauhan01779
 
PDF
Digital Marketing Course in Uttam Nagar-NSIM
saqibembibe
 
PPTX
How to Grow Twitter Followers: Proven Strategies for Success
phpcodingmaster
 
PPTX
Best Digital Marketing Course in Jalandhar
alwayserror12
 
PPTX
C&C_Profile_2025_Solutions to Unlock Business & Brand Potential.pptx
vishalp2011
 
PPTX
Essentials of Digital Marketing_the.pptx
Abu Bashar
 
PDF
Boost website visibility with smart SEO.
DIGITAL-GROWTH
 
PPT
4P'Marketing Mix / Element of Marketing Mix/Concept - BBA.ppt
Shree Nithi
 
PPTX
Consumer Attitude formation and Change.pptx
abhijitghosh13111995
 
PDF
The best Linux course in Jalandhar.pdf
prabhkiran684
 
PDF
Bulk Email Marketing for Modern Marketers
lavanya27077
 
PPTX
ppt srawani mela 2025 full media options
suyogkulkarni39
 
PDF
The Ultimate Guide to the Best Bulk Email Verification Tools.pdf
mahalekshmi15
 
PPTX
Digital Marketing for beginners_sta.pptx
Abu Bashar
 
PDF
Pdf of a the Social Media Marketing.pdf
r62544400
 
PDF
AI & Automation: The Future of Marketing or the End of Creativity - Jose Vict...
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
PPTX
LinkedIn_Growth_Playbook_AlternateView.pptx
ymanoj3
 
Marketing Mix - Mrs.S.Shree Nithi - BBA-02.07.2025.ppt
shreenithis2
 
KFC Brand Audit and Marketing Strategies
ASHITHA P R
 
Tesla_Motor Company Marketing_Strategy.pptx
obotecollince
 
SEO Solutions Boosting Growth | TechCadd
radhikachauhan01779
 
Digital Marketing Course in Uttam Nagar-NSIM
saqibembibe
 
How to Grow Twitter Followers: Proven Strategies for Success
phpcodingmaster
 
Best Digital Marketing Course in Jalandhar
alwayserror12
 
C&C_Profile_2025_Solutions to Unlock Business & Brand Potential.pptx
vishalp2011
 
Essentials of Digital Marketing_the.pptx
Abu Bashar
 
Boost website visibility with smart SEO.
DIGITAL-GROWTH
 
4P'Marketing Mix / Element of Marketing Mix/Concept - BBA.ppt
Shree Nithi
 
Consumer Attitude formation and Change.pptx
abhijitghosh13111995
 
The best Linux course in Jalandhar.pdf
prabhkiran684
 
Bulk Email Marketing for Modern Marketers
lavanya27077
 
ppt srawani mela 2025 full media options
suyogkulkarni39
 
The Ultimate Guide to the Best Bulk Email Verification Tools.pdf
mahalekshmi15
 
Digital Marketing for beginners_sta.pptx
Abu Bashar
 
Pdf of a the Social Media Marketing.pdf
r62544400
 
AI & Automation: The Future of Marketing or the End of Creativity - Jose Vict...
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
LinkedIn_Growth_Playbook_AlternateView.pptx
ymanoj3
 
Ad

WordPress custom posts types for structured content

  • 1. Custom Post Types F o r m o r e s t r u c t u r e d c o n t e n t i n W o r d P r e s s
  • 2. Introduction Custom post types allow you to make WordPress a much more flexible and feature rich content management system. In this meetup we’ll discuss how to setup, customize, organize and implement multiple custom post types into your website or project, and then connect them together to handle different types of content in a more structured and effective way.
  • 3. 3 What We’ll (try) to Cover Here’s a quick rundown of what I hope we can talk about in the time we have • The basics: What is a custom post type? • WordPress default Post types • Why would you need a custom post type for your site? • Examples of custom post types and where they are used • How to create a custom post types and taxonomies for your site • How to display your custom post types in your theme • How and Why to connect multiple custom post types together • Code samples and how to use them in your theme • Custom post types resources and links to get started or learn more • Q & A
  • 4. 4 What is a custom post type? Custom post types extend wordpress to add functionality beyond the default post types A custom post type is just a “post” with a different “post_type” value saved in the database. • WordPress added custom post types to the core in version 3.0. • Standard posts (blog posts) have a post type of “post”. • Standard Pages have a post type of “page”. • Your custom post type can be whatever you want • For example: “Staff”, “Portfolio”, etc… • Custom post types show up as separate menu items • Can have their own categories and tags (taxonomies) and can act like a post or a page • Can have all, some or none of the standard features • Can use custom loops to call this content anywhere in your theme
  • 5. 5 Default WordPress Post Types Here’s what you get out of the box Posts (Post Type: 'post')1 Pages (Post Type: ‘page')2 Navigation Menus (Post Type: 'nav_menu_item')3 Attachments (Post Type: ‘attachment')4 Revision (Post Type: ‘revision')5
  • 6. 6 Why would you need a custom post type? Why go through the trouble of using custom post types at all? Flexible Content Management Custom Data Fields Better Content Structure Be Searchable If your content needs to be displayed differently than a standard post or page you can create custom page layouts for each content type (i.e., unique layout)1 If you need more fields to manage all the information for a specific type of content on your website (i.e., house amenities, car features, etc)2 If you want your content to have it’s own unique URL (permalink) structure separate from posts and pages. For example “www.mydomain.com/staff/jimmy-john/”3 To more easily manage your content in the WordPress admin. Each custom post type has it’s own tab and edit screens to keep things organized4
  • 7. 7 Post Type Example North Okaloosa Physicians Group – Physicians Custom Post Type Archive Listing (template-physicians.php) Here we used a custom post type “Physician” to organize and display all the physicians in a custom designed archive or “list” page Custom Archive Page Custom Query & Loop to display Custom Page Template Custom Search Based On Post Type Can expand the content in the future
  • 8. 8 Post Type Example North Okaloosa Physicians Group – Physicians Custom Post Type Detail Page (single-physician.php) Custom post type “Physician” single page. Each physician has a detailed bio page. Which also brings in data from connected “specialties” Custom Detail Page Custom Query & Loop to display Unique Layout Display Custom Meta Fields Easily edited should info change
  • 9. 9 Post Type Example North Okaloosa Physicians Group – Physicians Custom Post Type Edit Screen Custom “Physician” edit screen in WP admin has multiple custom fields and meta boxes to complete a detailed profile of each physician. Custom Edit Screen Custom Meta Boxes and Data Fields Connected “Specialty” post type Custom Taxonomy Easily Expand Data Fields & connections
  • 10. How do you add a CPT? Now let’s looks at the code and plugins that allow you to add your own custom post types (CPT) and custom taxonomies
  • 11. 11 Create Custom Post Types Custom post types should ideally be placed in a plugin, but they don’t have to be 1. Use a custom plugin to hold your post type code 2. Use plugins to manage and create your post types
  • 12. Using a Custom Plugin Code your own plugin to handle your custom post types and taxonomonies so you can reuse it elsewhere or easily change your theme.
  • 13. 13 Creating a Basic Plugin Create a file called posttypes.php and add this code
  • 14. 14 Creating a Basic Custom Post Type Minimal code to register a custom post type
  • 15. 15 Creating Advanced Custom Post Types Complete code to register a custom post type
  • 16. 16 Creating a Custom Taxonomy Code to register a custom taxomony
  • 17. Using Existing Plugins Using existing, supported and frequently updated plugins is a good way to manage your custom post types and custom fields
  • 18. 18 Custom Post Type UI – Post Type Super easy to create post types and taxonomies
  • 19. 19 Custom Post Type UI -Taxonomy Super easy to create post types and taxonomies
  • 20. 20 Display Post Types In Your Theme Code to display a custom post type
  • 21. 21 Connecting Post Types Together Use a plugin to associate post types together to create a relationship
  • 22. 22 Connecting Post Types Together create a relationship – Add the PHP and get the connections meta box on your post types
  • 23. 23 Connecting Post Types Together Display connected posts in theme template file with PHP
  • 24. 24 Connecting Post Types Together Display connected posts with the provided P2P widget
  • 25. 25 Custom Post Type Resources Links and additional resources if you want to go deeper into it WordPress Codex CPT https://codex.wordpress.org/Post_Types Custom Post Type UI Plugin https://wordpress.org/plugins/custom-post-type-ui/ Advanced Custom Fields https://wordpress.org/plugins/advanced-custom-fields/ Smashing Magazine Custom Post Type Article (2015) http://www.smashingmagazine.com/2015/04/extending-wordpress-custom-content- types/ Design Wall Custom Post Type Article (2014) http://www.designwall.com/blog/use-custom-post-types-taxonomies-make-wordpress- even-useful/
  • 27. Thanks for Watching Do you have any questions or awesomeness you’d like to share? www.firestormcs.com [email protected] @firestormcs /FirestormCreativeStudios Stay in touch: