SlideShare una empresa de Scribd logo
1 de 24
An Introduction toAn Introduction to
Custom PostCustom Post
TypesTypes
Presented by Troy ChaplinPresented by Troy Chaplin
Web Developer & WordPress EnthusiastWeb Developer & WordPress Enthusiast
A Little About MeA Little About Me
Graphic design diploma from StGraphic design diploma from St
Lawrence College and self taughtLawrence College and self taught
web developer.web developer.
8 year career in print design and8 year career in print design and
layout, marketing, advertising andlayout, marketing, advertising and
web design and development.web design and development.
4 years as a web developer at4 years as a web developer at
Carleton University designing andCarleton University designing and
developing custom CMS’ powereddeveloping custom CMS’ powered
by WordPress and helping maintainby WordPress and helping maintain
over 250 WP sites.over 250 WP sites.
Loves learning and working withLoves learning and working with
WordPress to try and find better andWordPress to try and find better and
more intuitive ways to build custommore intuitive ways to build custom
functionality.functionality.
I never code alone.I never code alone.
Sprott School ofSprott School of
BusinessBusiness
Carleton NewsroomCarleton Newsroom
Graduate AdmissionsGraduate Admissions
Carleton AthleticsCarleton Athletics
Carleton HousingCarleton Housing
All those examples useAll those examples use
a variety of custom posta variety of custom post
typestypes
But we’ll take a closer look at those laterBut we’ll take a closer look at those later
About Custom PostAbout Custom Post
TypesTypes
If you’ve used WordPress, then you may be surprised toIf you’ve used WordPress, then you may be surprised to
learn that you’ve been using custom post types all along.learn that you’ve been using custom post types all along.
WordPress uses 5 default post types: posts, pages,WordPress uses 5 default post types: posts, pages,
attachments, revisions and nav menus.attachments, revisions and nav menus.
Provides the ability to create new content areas andProvides the ability to create new content areas and
separate content on large sites.separate content on large sites.
Designers and developers can create layouts andDesigners and developers can create layouts and
functionality that is separate from posts and pages.functionality that is separate from posts and pages.
Used by several plugins to add specific functionality thatUsed by several plugins to add specific functionality that
does not impact the default post types.does not impact the default post types.
Its Name Can beIts Name Can be
ConfusingConfusing
Custom post types?Custom post types?
Isn’t that the same thingIsn’t that the same thing
as the default posts?as the default posts?
What’s the difference?What’s the difference?
I prefer to think of it as aI prefer to think of it as a
Custom Content Type.Custom Content Type.
It is tied to none of theIt is tied to none of the
default post types, actsdefault post types, acts
as a stand aloneas a stand alone
content area.content area.
Custom Post TypeCustom Post Type
FunctionalityFunctionality
Can mirror the familiar functionality of posts: non-Can mirror the familiar functionality of posts: non-
hierarchical, categorization, tagging capabilities.hierarchical, categorization, tagging capabilities.
Can also reflect the pages environment: pageCan also reflect the pages environment: page
attributes, parent-child relationships.attributes, parent-child relationships.
Both can support titles, editors, revisions, customBoth can support titles, editors, revisions, custom
fields, thumbnails, comments and more.fields, thumbnails, comments and more.
Both act and are organized independently from theBoth act and are organized independently from the
default posts and pages and can be tailored to suit adefault posts and pages and can be tailored to suit a
variety of needs across your website.variety of needs across your website.
Sprott School ofSprott School of
BusinessBusiness
Homepage slideshowHomepage slideshow
and other content areasand other content areas
are control with aare control with a
homepage custom posthomepage custom post
type.type.
Chronologically sortedChronologically sorted
upcoming events list.upcoming events list.
Alphabetically sorted listAlphabetically sorted list
of faculty and staffof faculty and staff
members.members.
Carleton NewsroomCarleton Newsroom
Homepage featuredHomepage featured
story and video settings.story and video settings.
Default posts as well asDefault posts as well as
several custom postseveral custom post
types feeding into thetypes feeding into the
homepage.homepage.
In the News is a customIn the News is a custom
post type to helppost type to help
separate internal newsseparate internal news
from external news.from external news.
Alphabetically sortedAlphabetically sorted
experts at Carletonexperts at Carleton
listing.listing.
Graduate AdmissionsGraduate Admissions
Homepage slideshow.Homepage slideshow.
Alphabetical list ofAlphabetical list of
programs, split into threeprograms, split into three
main categories.main categories.
Chronologically sortedChronologically sorted
upcoming events list.upcoming events list.
Video gallery.Video gallery.
International studentInternational student
requirements, sortedrequirements, sorted
alphabetically byalphabetically by
country.country.
Carleton AthleticsCarleton Athletics
Campus and kidsCampus and kids
program listing.program listing.
Fitness class listing.Fitness class listing.
Leagues and recreationLeagues and recreation
listing.listing.
Pool and facilities listing.Pool and facilities listing.
Site wideSite wide
advertisements.advertisements.
Carleton HousingCarleton Housing
Homepage with contentHomepage with content
customization options.customization options.
Alphabetical listing ofAlphabetical listing of
campus residencecampus residence
buildings.buildings.
Video gallery.Video gallery.
Off campus housingOff campus housing
listings.listings.
Student testimonials.Student testimonials.
Promotional highlights.Promotional highlights.
More Ways to Use Custom PostMore Ways to Use Custom Post
TypesTypes
Entertainment sites: custom post types to separateEntertainment sites: custom post types to separate
content for movies, television shows, music, books,content for movies, television shows, music, books,
games and more.games and more.
Sports: custom post types to separate content forSports: custom post types to separate content for
hockey, basketball, baseball, football, golf and more.hockey, basketball, baseball, football, golf and more.
Online magazines: custom post types to separateOnline magazines: custom post types to separate
content for editorial section such as features, letters,content for editorial section such as features, letters,
shorts, guest columnists and more.shorts, guest columnists and more.
The Basics of theThe Basics of the
FunctionFunction
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'wco_notes',
array(
'labels' => array(
'name' => __( 'WordCamp Notes' ),
'singular_name' => __( 'WordCamp
Note' )
),
'public' => true,
'has_archive' => true,
)
);
}
Theme FilesTheme Files
Custom post type archives functions similar to theCustom post type archives functions similar to the
category template using a file namedcategory template using a file named archive-archive-
post_type_name.phppost_type_name.php
Single page function like a post or page and use aSingle page function like a post or page and use a
template file namedtemplate file named single-post_type_name.phpsingle-post_type_name.php
If neither of these templates files exist WordPressIf neither of these templates files exist WordPress
would look for archive.php and single.php.would look for archive.php and single.php.
Default URL structure uses post_type_name, but canDefault URL structure uses post_type_name, but can
be customized in more detailed function.be customized in more detailed function.
Example: http://sitename.ca/post_type_name/.Example: http://sitename.ca/post_type_name/.
Coding TutorialsCoding Tutorials
WordPress CodexWordPress Codex
http://codex.wordpress.org/Function_Reference/regihttp://codex.wordpress.org/Function_Reference/regi
ster_post_typester_post_type
Justin TadlockJustin Tadlock
http://justintadlock.com/archives/2010/04/29/custohttp://justintadlock.com/archives/2010/04/29/custo
m-post-types-in-wordpressm-post-types-in-wordpress
Some Plugins to HelpSome Plugins to Help
Custom Post Type UICustom Post Type UI
http://wordpress.org/extend/plugins/custom-http://wordpress.org/extend/plugins/custom-
post-type-ui/post-type-ui/
TypesTypes
http://wordpress.org/extend/plugins/types/http://wordpress.org/extend/plugins/types/
Both plugins allow for quick and easy creation ofBoth plugins allow for quick and easy creation of
custom post types, as well as taxonomies /custom post types, as well as taxonomies /
categoriescategories
Things to RememberThings to Remember
Use post types to create unique sections on yourUse post types to create unique sections on your
site that provide functionality that is different thansite that provide functionality that is different than
that of default blog posts and pages.that of default blog posts and pages.
Use them on large scale site to better organize aUse them on large scale site to better organize a
variety of areas of content. Better for writers,variety of areas of content. Better for writers,
easier for visitors.easier for visitors.
Not comfortable with editing code? Use a plugin!Not comfortable with editing code? Use a plugin!
Think outside the box. Nothing is impossible.Think outside the box. Nothing is impossible.
Questions?Questions?
Troy ChaplinTroy Chaplin
troychaplin.catroychaplin.ca
@troychaplin@troychaplin
Thank You forThank You for
Coming!Coming!

Más contenido relacionado

La actualidad más candente

Social Media Marketing for the Lean Startup
Social Media Marketing for the Lean StartupSocial Media Marketing for the Lean Startup
Social Media Marketing for the Lean StartupEric Krock
 
Adding Content to your WordPress Website
Adding Content to your WordPress WebsiteAdding Content to your WordPress Website
Adding Content to your WordPress WebsiteRiceDesign
 
Community With BuddyPress (WordCamp Orlando 2011)
Community With BuddyPress (WordCamp Orlando 2011)Community With BuddyPress (WordCamp Orlando 2011)
Community With BuddyPress (WordCamp Orlando 2011)David Bisset
 
Advanced WordPress: Session II
Advanced WordPress: Session IIAdvanced WordPress: Session II
Advanced WordPress: Session IIDigital Wax Works
 
WordPress can do that?!
WordPress can do that?!WordPress can do that?!
WordPress can do that?!Scott McNulty
 
Advanced WordPress: Session I
Advanced WordPress: Session IAdvanced WordPress: Session I
Advanced WordPress: Session IDigital Wax Works
 
The International Image Interoperability Framework: why it's a game-changer f...
The International Image Interoperability Framework: why it's a game-changer f...The International Image Interoperability Framework: why it's a game-changer f...
The International Image Interoperability Framework: why it's a game-changer f...UCD Library
 
Part1 learn thelingo
Part1 learn thelingoPart1 learn thelingo
Part1 learn thelingoTaneya Koonce
 
Wordpress and Your Brand
Wordpress and Your BrandWordpress and Your Brand
Wordpress and Your BrandSara Cannon
 
Blogging Basics
Blogging BasicsBlogging Basics
Blogging BasicsRino Landa
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPressHarshad Mane
 
Beyond WP-CONTENT | #WCRaleigh
Beyond WP-CONTENT | #WCRaleighBeyond WP-CONTENT | #WCRaleigh
Beyond WP-CONTENT | #WCRaleighGlenn Ansley
 
Search Engine Optimize for WordPress in 3 Easy Steps
Search Engine Optimize for WordPress in 3 Easy StepsSearch Engine Optimize for WordPress in 3 Easy Steps
Search Engine Optimize for WordPress in 3 Easy StepsAnna Belle Leiserson
 
Pub355: SEO Copywriting
Pub355: SEO CopywritingPub355: SEO Copywriting
Pub355: SEO Copywritingsomisguided
 
WordPress A CMS for Beginners, Geeks and Those In-Between
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-BetweenHeidi Cool
 

La actualidad más candente (19)

Social Media Marketing for the Lean Startup
Social Media Marketing for the Lean StartupSocial Media Marketing for the Lean Startup
Social Media Marketing for the Lean Startup
 
Adding Content to your WordPress Website
Adding Content to your WordPress WebsiteAdding Content to your WordPress Website
Adding Content to your WordPress Website
 
Community With BuddyPress (WordCamp Orlando 2011)
Community With BuddyPress (WordCamp Orlando 2011)Community With BuddyPress (WordCamp Orlando 2011)
Community With BuddyPress (WordCamp Orlando 2011)
 
Advanced WordPress: Session II
Advanced WordPress: Session IIAdvanced WordPress: Session II
Advanced WordPress: Session II
 
WordPress can do that?!
WordPress can do that?!WordPress can do that?!
WordPress can do that?!
 
Advanced WordPress: Session I
Advanced WordPress: Session IAdvanced WordPress: Session I
Advanced WordPress: Session I
 
The International Image Interoperability Framework: why it's a game-changer f...
The International Image Interoperability Framework: why it's a game-changer f...The International Image Interoperability Framework: why it's a game-changer f...
The International Image Interoperability Framework: why it's a game-changer f...
 
Part1 learn thelingo
Part1 learn thelingoPart1 learn thelingo
Part1 learn thelingo
 
Wordpress and Your Brand
Wordpress and Your BrandWordpress and Your Brand
Wordpress and Your Brand
 
Down and Dirty EPUB 3
Down and Dirty EPUB 3Down and Dirty EPUB 3
Down and Dirty EPUB 3
 
Blogging Basics
Blogging BasicsBlogging Basics
Blogging Basics
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPress
 
Smash.wordpress
Smash.wordpressSmash.wordpress
Smash.wordpress
 
Beyond WP-CONTENT | #WCRaleigh
Beyond WP-CONTENT | #WCRaleighBeyond WP-CONTENT | #WCRaleigh
Beyond WP-CONTENT | #WCRaleigh
 
All starrs 9-12-11
All starrs 9-12-11 All starrs 9-12-11
All starrs 9-12-11
 
Search Engine Optimize for WordPress in 3 Easy Steps
Search Engine Optimize for WordPress in 3 Easy StepsSearch Engine Optimize for WordPress in 3 Easy Steps
Search Engine Optimize for WordPress in 3 Easy Steps
 
Pub355: SEO Copywriting
Pub355: SEO CopywritingPub355: SEO Copywriting
Pub355: SEO Copywriting
 
WordPress A CMS for Beginners, Geeks and Those In-Between
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
 
Blogging 101
Blogging 101Blogging 101
Blogging 101
 

Similar a An Introduction to Custom Post Types

What is WordPress and Why Is Everyone Talking About it
What is WordPress and Why Is Everyone Talking About itWhat is WordPress and Why Is Everyone Talking About it
What is WordPress and Why Is Everyone Talking About itBobWP.com
 
Wordcamp, India 2009 - How to Implement SEO on a Wordpress Blog - Wordpress S...
Wordcamp, India 2009 - How to Implement SEO on a Wordpress Blog - Wordpress S...Wordcamp, India 2009 - How to Implement SEO on a Wordpress Blog - Wordpress S...
Wordcamp, India 2009 - How to Implement SEO on a Wordpress Blog - Wordpress S...Abhinav Gulyani
 
Building a website with WordPress
Building a website with WordPressBuilding a website with WordPress
Building a website with WordPressAnthony Montalbano
 
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事Ronald Hsu
 
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
Word press bootcamp  By Sourcescript Innovations and Mentors DojoWord press bootcamp  By Sourcescript Innovations and Mentors Dojo
Word press bootcamp By Sourcescript Innovations and Mentors Dojolightshire
 
Getting to know WordPress
Getting to know WordPressGetting to know WordPress
Getting to know WordPressAnthony Hortin
 
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...Evan Mullins
 
What Is WordPress and Why Is Everyone Talking About It
What Is WordPress and Why Is Everyone Talking About ItWhat Is WordPress and Why Is Everyone Talking About It
What Is WordPress and Why Is Everyone Talking About ItBobWP.com
 
Cms Workshop Long
Cms Workshop LongCms Workshop Long
Cms Workshop Longemily
 
WordPress Installation Tutorial - How to Install WordPress manually
WordPress Installation Tutorial - How to Install WordPress manuallyWordPress Installation Tutorial - How to Install WordPress manually
WordPress Installation Tutorial - How to Install WordPress manuallyBalaji kaliamoorthy
 
Learning by Doing: 10 Lessons in Pushing your WordPress Development Skills
Learning by Doing: 10 Lessons in Pushing your WordPress Development SkillsLearning by Doing: 10 Lessons in Pushing your WordPress Development Skills
Learning by Doing: 10 Lessons in Pushing your WordPress Development SkillsSarah Moyer
 
Information Architecture has everything to do with your theme!
Information Architecture has everything to do with your theme!Information Architecture has everything to do with your theme!
Information Architecture has everything to do with your theme!Steven Slack
 
Hands On WordPress SEO Mozinar - June 4, 2013
Hands On WordPress SEO Mozinar - June 4, 2013Hands On WordPress SEO Mozinar - June 4, 2013
Hands On WordPress SEO Mozinar - June 4, 2013Evolving SEO
 
Blogging For Business Wordpress 1
Blogging For Business Wordpress 1Blogging For Business Wordpress 1
Blogging For Business Wordpress 1Social Jack
 
WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...Denise Williams
 
WordPress custom posts types for structured content
WordPress custom posts types for structured contentWordPress custom posts types for structured content
WordPress custom posts types for structured contentFirestorm Creative Studios
 
Getting Acclimated to WordPress
Getting Acclimated to WordPressGetting Acclimated to WordPress
Getting Acclimated to WordPressAnthony Montalbano
 

Similar a An Introduction to Custom Post Types (20)

IBM Connection - customize it, #dd13
IBM Connection - customize it, #dd13IBM Connection - customize it, #dd13
IBM Connection - customize it, #dd13
 
SEO for WordPress Blogs
SEO for WordPress BlogsSEO for WordPress Blogs
SEO for WordPress Blogs
 
What is WordPress and Why Is Everyone Talking About it
What is WordPress and Why Is Everyone Talking About itWhat is WordPress and Why Is Everyone Talking About it
What is WordPress and Why Is Everyone Talking About it
 
Wordcamp, India 2009 - How to Implement SEO on a Wordpress Blog - Wordpress S...
Wordcamp, India 2009 - How to Implement SEO on a Wordpress Blog - Wordpress S...Wordcamp, India 2009 - How to Implement SEO on a Wordpress Blog - Wordpress S...
Wordcamp, India 2009 - How to Implement SEO on a Wordpress Blog - Wordpress S...
 
Building a website with WordPress
Building a website with WordPressBuilding a website with WordPress
Building a website with WordPress
 
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
 
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
Word press bootcamp  By Sourcescript Innovations and Mentors DojoWord press bootcamp  By Sourcescript Innovations and Mentors Dojo
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
 
Meet WordPress
Meet WordPressMeet WordPress
Meet WordPress
 
Getting to know WordPress
Getting to know WordPressGetting to know WordPress
Getting to know WordPress
 
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
 
What Is WordPress and Why Is Everyone Talking About It
What Is WordPress and Why Is Everyone Talking About ItWhat Is WordPress and Why Is Everyone Talking About It
What Is WordPress and Why Is Everyone Talking About It
 
Cms Workshop Long
Cms Workshop LongCms Workshop Long
Cms Workshop Long
 
WordPress Installation Tutorial - How to Install WordPress manually
WordPress Installation Tutorial - How to Install WordPress manuallyWordPress Installation Tutorial - How to Install WordPress manually
WordPress Installation Tutorial - How to Install WordPress manually
 
Learning by Doing: 10 Lessons in Pushing your WordPress Development Skills
Learning by Doing: 10 Lessons in Pushing your WordPress Development SkillsLearning by Doing: 10 Lessons in Pushing your WordPress Development Skills
Learning by Doing: 10 Lessons in Pushing your WordPress Development Skills
 
Information Architecture has everything to do with your theme!
Information Architecture has everything to do with your theme!Information Architecture has everything to do with your theme!
Information Architecture has everything to do with your theme!
 
Hands On WordPress SEO Mozinar - June 4, 2013
Hands On WordPress SEO Mozinar - June 4, 2013Hands On WordPress SEO Mozinar - June 4, 2013
Hands On WordPress SEO Mozinar - June 4, 2013
 
Blogging For Business Wordpress 1
Blogging For Business Wordpress 1Blogging For Business Wordpress 1
Blogging For Business Wordpress 1
 
WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...
 
WordPress custom posts types for structured content
WordPress custom posts types for structured contentWordPress custom posts types for structured content
WordPress custom posts types for structured content
 
Getting Acclimated to WordPress
Getting Acclimated to WordPressGetting Acclimated to WordPress
Getting Acclimated to WordPress
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 

Último (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

An Introduction to Custom Post Types

  • 1. An Introduction toAn Introduction to Custom PostCustom Post TypesTypes Presented by Troy ChaplinPresented by Troy Chaplin Web Developer & WordPress EnthusiastWeb Developer & WordPress Enthusiast
  • 2. A Little About MeA Little About Me Graphic design diploma from StGraphic design diploma from St Lawrence College and self taughtLawrence College and self taught web developer.web developer. 8 year career in print design and8 year career in print design and layout, marketing, advertising andlayout, marketing, advertising and web design and development.web design and development. 4 years as a web developer at4 years as a web developer at Carleton University designing andCarleton University designing and developing custom CMS’ powereddeveloping custom CMS’ powered by WordPress and helping maintainby WordPress and helping maintain over 250 WP sites.over 250 WP sites. Loves learning and working withLoves learning and working with WordPress to try and find better andWordPress to try and find better and more intuitive ways to build custommore intuitive ways to build custom functionality.functionality. I never code alone.I never code alone.
  • 3. Sprott School ofSprott School of BusinessBusiness
  • 8. All those examples useAll those examples use a variety of custom posta variety of custom post typestypes But we’ll take a closer look at those laterBut we’ll take a closer look at those later
  • 9. About Custom PostAbout Custom Post TypesTypes If you’ve used WordPress, then you may be surprised toIf you’ve used WordPress, then you may be surprised to learn that you’ve been using custom post types all along.learn that you’ve been using custom post types all along. WordPress uses 5 default post types: posts, pages,WordPress uses 5 default post types: posts, pages, attachments, revisions and nav menus.attachments, revisions and nav menus. Provides the ability to create new content areas andProvides the ability to create new content areas and separate content on large sites.separate content on large sites. Designers and developers can create layouts andDesigners and developers can create layouts and functionality that is separate from posts and pages.functionality that is separate from posts and pages. Used by several plugins to add specific functionality thatUsed by several plugins to add specific functionality that does not impact the default post types.does not impact the default post types.
  • 10. Its Name Can beIts Name Can be ConfusingConfusing Custom post types?Custom post types? Isn’t that the same thingIsn’t that the same thing as the default posts?as the default posts? What’s the difference?What’s the difference? I prefer to think of it as aI prefer to think of it as a Custom Content Type.Custom Content Type. It is tied to none of theIt is tied to none of the default post types, actsdefault post types, acts as a stand aloneas a stand alone content area.content area.
  • 11. Custom Post TypeCustom Post Type FunctionalityFunctionality Can mirror the familiar functionality of posts: non-Can mirror the familiar functionality of posts: non- hierarchical, categorization, tagging capabilities.hierarchical, categorization, tagging capabilities. Can also reflect the pages environment: pageCan also reflect the pages environment: page attributes, parent-child relationships.attributes, parent-child relationships. Both can support titles, editors, revisions, customBoth can support titles, editors, revisions, custom fields, thumbnails, comments and more.fields, thumbnails, comments and more. Both act and are organized independently from theBoth act and are organized independently from the default posts and pages and can be tailored to suit adefault posts and pages and can be tailored to suit a variety of needs across your website.variety of needs across your website.
  • 12. Sprott School ofSprott School of BusinessBusiness Homepage slideshowHomepage slideshow and other content areasand other content areas are control with aare control with a homepage custom posthomepage custom post type.type. Chronologically sortedChronologically sorted upcoming events list.upcoming events list. Alphabetically sorted listAlphabetically sorted list of faculty and staffof faculty and staff members.members.
  • 13. Carleton NewsroomCarleton Newsroom Homepage featuredHomepage featured story and video settings.story and video settings. Default posts as well asDefault posts as well as several custom postseveral custom post types feeding into thetypes feeding into the homepage.homepage. In the News is a customIn the News is a custom post type to helppost type to help separate internal newsseparate internal news from external news.from external news. Alphabetically sortedAlphabetically sorted experts at Carletonexperts at Carleton listing.listing.
  • 14. Graduate AdmissionsGraduate Admissions Homepage slideshow.Homepage slideshow. Alphabetical list ofAlphabetical list of programs, split into threeprograms, split into three main categories.main categories. Chronologically sortedChronologically sorted upcoming events list.upcoming events list. Video gallery.Video gallery. International studentInternational student requirements, sortedrequirements, sorted alphabetically byalphabetically by country.country.
  • 15. Carleton AthleticsCarleton Athletics Campus and kidsCampus and kids program listing.program listing. Fitness class listing.Fitness class listing. Leagues and recreationLeagues and recreation listing.listing. Pool and facilities listing.Pool and facilities listing. Site wideSite wide advertisements.advertisements.
  • 16. Carleton HousingCarleton Housing Homepage with contentHomepage with content customization options.customization options. Alphabetical listing ofAlphabetical listing of campus residencecampus residence buildings.buildings. Video gallery.Video gallery. Off campus housingOff campus housing listings.listings. Student testimonials.Student testimonials. Promotional highlights.Promotional highlights.
  • 17. More Ways to Use Custom PostMore Ways to Use Custom Post TypesTypes Entertainment sites: custom post types to separateEntertainment sites: custom post types to separate content for movies, television shows, music, books,content for movies, television shows, music, books, games and more.games and more. Sports: custom post types to separate content forSports: custom post types to separate content for hockey, basketball, baseball, football, golf and more.hockey, basketball, baseball, football, golf and more. Online magazines: custom post types to separateOnline magazines: custom post types to separate content for editorial section such as features, letters,content for editorial section such as features, letters, shorts, guest columnists and more.shorts, guest columnists and more.
  • 18. The Basics of theThe Basics of the FunctionFunction add_action( 'init', 'create_post_type' ); function create_post_type() { register_post_type( 'wco_notes', array( 'labels' => array( 'name' => __( 'WordCamp Notes' ), 'singular_name' => __( 'WordCamp Note' ) ), 'public' => true, 'has_archive' => true, ) ); }
  • 19. Theme FilesTheme Files Custom post type archives functions similar to theCustom post type archives functions similar to the category template using a file namedcategory template using a file named archive-archive- post_type_name.phppost_type_name.php Single page function like a post or page and use aSingle page function like a post or page and use a template file namedtemplate file named single-post_type_name.phpsingle-post_type_name.php If neither of these templates files exist WordPressIf neither of these templates files exist WordPress would look for archive.php and single.php.would look for archive.php and single.php. Default URL structure uses post_type_name, but canDefault URL structure uses post_type_name, but can be customized in more detailed function.be customized in more detailed function. Example: http://sitename.ca/post_type_name/.Example: http://sitename.ca/post_type_name/.
  • 20. Coding TutorialsCoding Tutorials WordPress CodexWordPress Codex http://codex.wordpress.org/Function_Reference/regihttp://codex.wordpress.org/Function_Reference/regi ster_post_typester_post_type Justin TadlockJustin Tadlock http://justintadlock.com/archives/2010/04/29/custohttp://justintadlock.com/archives/2010/04/29/custo m-post-types-in-wordpressm-post-types-in-wordpress
  • 21. Some Plugins to HelpSome Plugins to Help Custom Post Type UICustom Post Type UI http://wordpress.org/extend/plugins/custom-http://wordpress.org/extend/plugins/custom- post-type-ui/post-type-ui/ TypesTypes http://wordpress.org/extend/plugins/types/http://wordpress.org/extend/plugins/types/ Both plugins allow for quick and easy creation ofBoth plugins allow for quick and easy creation of custom post types, as well as taxonomies /custom post types, as well as taxonomies / categoriescategories
  • 22. Things to RememberThings to Remember Use post types to create unique sections on yourUse post types to create unique sections on your site that provide functionality that is different thansite that provide functionality that is different than that of default blog posts and pages.that of default blog posts and pages. Use them on large scale site to better organize aUse them on large scale site to better organize a variety of areas of content. Better for writers,variety of areas of content. Better for writers, easier for visitors.easier for visitors. Not comfortable with editing code? Use a plugin!Not comfortable with editing code? Use a plugin! Think outside the box. Nothing is impossible.Think outside the box. Nothing is impossible.