SlideShare a Scribd company logo
1 of 29
Creating Custom Post
Types
UCF Marketing
Brandon Groves
webcom@ucf.edu
http://www.slideshare.net/DFieldFL/wordpress-create-custom-post-types
Outline
 UCF Marketing background
 What are custom post types (CPTs)
 How to create a CPTs
 How to display CPTs
 How we (SMCA) create CPTs
 Conclusion
 Questions/Comments
UCF Marketing background
Web Development Team
 Roger Wolf
 Jo Greybill
 Brandon Groves
Been using WordPress for 5 Years
Develop ~12 sites a year
Sites we developed using WordPress
 http://www.ucf.edu
 http://today.ucf.edu
 http://pegasus.ucf.edu
 http://hr.ucf.edu
 http://hospitality.ucf.edu
What are custom post
types (CPTs)
Most content uses post types [1]
 Posts
 Pages
 Navigation Menu
 Attachment
 Revision
CPT
[1] http://codex.wordpress.org/Post_Types#Custom_Post_Types
A way of organizing content
 Announcements
 People
 Documents
Add custom data
 Meta data
 Featured image
 Taxonomies
Remove fields
 Title
 Content
Meta data
 When creating CPTs you
have to also create a way of
displaying them
 CPTs are NOT displayed
anywhere by default
(except via single.php)
Has anyone used custom post types?
Other use-cases
 http://www.bard.edu/ccs/
 http://www.cec.fiu.edu/academics/bachelor/
 http://www.nicholls.edu/admission/
 http://pegasus.ucf.edu/
How to create CPTs
Selling ACME products
 List all product that are sold
 Individual product page with descriptions
Resources
 http://codex.wordpress.org/Post_Types
 http://codex.wordpress.org/Function_Refere
nce/register_post_type
 http://codex.wordpress.org/Plugin_API/Actio
n_Reference
Reserved Post Types [2]
 post
 page
 attachment
 revision
 nav_menu_item
Register CPT [2]
 Post type ID (required)
 Arguments – defining characteristics of the CPT
[2] http://codex.wordpress.org/Function_Reference/register_post_type#Reserved_Post_Types
Hook function into the workflow
 Functions.php file is auto loaded [3]
 Convenience method add_action [4] [5]
 When to execute our code
 What code to execute
 Priority compared to other added actions
 Arguments
[3] http://codex.wordpress.org/Theme_Development#Functions_File
[4] http://codex.wordpress.org/Function_Reference/add_action
[5] http://codex.wordpress.org/Plugin_API/Action_Reference
Code
 {theme}/functions.php
CPT displays on left menu
 Displays posts
 Add new post
A CPT by default looks the
same as Post
 Title
 Content/Body
How to display CPTs
Create products
 Anvil
 Giant Rubber Band
Where are our products?
Template structure [6]
 A single page to display products
 Pages are automatically put into the menu
 page-{slug}.php filename
 Content title is used for the slug
[6] http://codex.wordpress.org/Template_Hierarchy
Creating our own display page
Empty page
 Defaults to page.php
Create template
 using the page slug file naming convention
(page-products.php)
 Querie our CPT of amce_products (The Loop) [7]
[7] http://codex.wordpress.org/The_Loop
The Loop
Products page
View a product
 Defaults to single.php [6]
[6] http://codex.wordpress.org/Template_Hierarchy
Create a custom display
 Displaying single CTP (single-{post-type-id}.php) [6]
[6] http://codex.wordpress.org/Template_Hierarchy
Displaying single CTP (single-acme_product.php)
How we (SMCA) create CPTs
Resources
 https://github.com/UCF/Wordpress-Generic-Theme
Code
 custom-post-types.php (Base CPT Class)
Defining a new CPT (Document)
 Inherit CustomePostType class
 Modify variables if needed
Defining a new CPT
 Add custom functionality
Enabling CPT (registering)
 Add CPT class name to the Config’s custom_post_types
array (functions/config.php)
How we (SMCA) create CPTs
Conclusion
WordPress is more than a blogging tool
CPTs help group like content
CPTs are NOT displayed by default
 Manually link to it
 Create a display page listing CPTs (page templates)
 Create unique single post display (post templates)
Questions?
http://www.slideshare.net/DFieldFL/wordpress-create-custom-post-types
Contact: webcom@ucf.edu

More Related Content

What's hot

Joomla 4 custom fields and workflow
Joomla 4 custom fields and workflowJoomla 4 custom fields and workflow
Joomla 4 custom fields and workflowTim Plummer
 
Handling User-Generated Duplicate Content on Your Website
Handling User-Generated Duplicate Content on Your WebsiteHandling User-Generated Duplicate Content on Your Website
Handling User-Generated Duplicate Content on Your WebsiteDhairya Shah
 
TinyMCE for Joomla
TinyMCE for JoomlaTinyMCE for Joomla
TinyMCE for JoomlaTim Plummer
 
Building a website with WordPress
Building a website with WordPressBuilding a website with WordPress
Building a website with WordPressAnthony Montalbano
 
Adding Content to your WordPress Website
Adding Content to your WordPress WebsiteAdding Content to your WordPress Website
Adding Content to your WordPress WebsiteRiceDesign
 
SugarCRM: Tips Tricks And Tools
SugarCRM: Tips Tricks And ToolsSugarCRM: Tips Tricks And Tools
SugarCRM: Tips Tricks And ToolsJosh Sweeney
 
Exploring the WordPress Dashboard and How to Pick & Install Plugins
Exploring the WordPress Dashboard and How to Pick & Install PluginsExploring the WordPress Dashboard and How to Pick & Install Plugins
Exploring the WordPress Dashboard and How to Pick & Install PluginsRich Plakas
 
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
 
Fm Rh Doc Bash Aug2011
Fm Rh Doc Bash Aug2011Fm Rh Doc Bash Aug2011
Fm Rh Doc Bash Aug2011Nandini Gupta
 
Aujug 2020 joomla 4 workflow
Aujug 2020 joomla 4 workflowAujug 2020 joomla 4 workflow
Aujug 2020 joomla 4 workflowTim Plummer
 
What Is WordPress and Why Should I Use It? - Workshop April 2015
What Is WordPress and Why Should I Use It? - Workshop April 2015What Is WordPress and Why Should I Use It? - Workshop April 2015
What Is WordPress and Why Should I Use It? - Workshop April 2015BobWP.com
 
WordPress for Beginners
WordPress for BeginnersWordPress for Beginners
WordPress for BeginnersMichelle Ames
 
Schipul Webinar - Intro To Wordpress
Schipul Webinar - Intro To WordpressSchipul Webinar - Intro To Wordpress
Schipul Webinar - Intro To WordpressCaitlin Jeansonne
 
Cross CMS plugin development using AWF
Cross CMS plugin development using AWFCross CMS plugin development using AWF
Cross CMS plugin development using AWFTim Plummer
 
Wordpress Intro
Wordpress IntroWordpress Intro
Wordpress IntroRicha Goel
 
Word press themeing & more
Word press themeing & moreWord press themeing & more
Word press themeing & morePhelan Riessen
 

What's hot (20)

Joomla 4 custom fields and workflow
Joomla 4 custom fields and workflowJoomla 4 custom fields and workflow
Joomla 4 custom fields and workflow
 
Handling User-Generated Duplicate Content on Your Website
Handling User-Generated Duplicate Content on Your WebsiteHandling User-Generated Duplicate Content on Your Website
Handling User-Generated Duplicate Content on Your Website
 
TinyMCE for Joomla
TinyMCE for JoomlaTinyMCE for Joomla
TinyMCE for Joomla
 
Web development is now simplified with Wordpress CMS
Web development is now simplified with Wordpress CMSWeb development is now simplified with Wordpress CMS
Web development is now simplified with Wordpress CMS
 
Learning center usage
Learning center usageLearning center usage
Learning center usage
 
Building a website with WordPress
Building a website with WordPressBuilding a website with WordPress
Building a website with WordPress
 
Adding Content to your WordPress Website
Adding Content to your WordPress WebsiteAdding Content to your WordPress Website
Adding Content to your WordPress Website
 
SugarCRM: Tips Tricks And Tools
SugarCRM: Tips Tricks And ToolsSugarCRM: Tips Tricks And Tools
SugarCRM: Tips Tricks And Tools
 
Exploring the WordPress Dashboard and How to Pick & Install Plugins
Exploring the WordPress Dashboard and How to Pick & Install PluginsExploring the WordPress Dashboard and How to Pick & Install Plugins
Exploring the WordPress Dashboard and How to Pick & Install Plugins
 
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 for Beginners: 10 Must Knows
Wordpress for Beginners: 10 Must KnowsWordpress for Beginners: 10 Must Knows
Wordpress for Beginners: 10 Must Knows
 
Fm Rh Doc Bash Aug2011
Fm Rh Doc Bash Aug2011Fm Rh Doc Bash Aug2011
Fm Rh Doc Bash Aug2011
 
Aujug 2020 joomla 4 workflow
Aujug 2020 joomla 4 workflowAujug 2020 joomla 4 workflow
Aujug 2020 joomla 4 workflow
 
What Is WordPress and Why Should I Use It? - Workshop April 2015
What Is WordPress and Why Should I Use It? - Workshop April 2015What Is WordPress and Why Should I Use It? - Workshop April 2015
What Is WordPress and Why Should I Use It? - Workshop April 2015
 
WordPress for Beginners
WordPress for BeginnersWordPress for Beginners
WordPress for Beginners
 
Schipul Webinar - Intro To Wordpress
Schipul Webinar - Intro To WordpressSchipul Webinar - Intro To Wordpress
Schipul Webinar - Intro To Wordpress
 
Cross CMS plugin development using AWF
Cross CMS plugin development using AWFCross CMS plugin development using AWF
Cross CMS plugin development using AWF
 
Wordpress Intro
Wordpress IntroWordpress Intro
Wordpress Intro
 
The WordPress Author
The WordPress AuthorThe WordPress Author
The WordPress Author
 
Word press themeing & more
Word press themeing & moreWord press themeing & more
Word press themeing & more
 

Similar to WordPress - Create Custom Post Types

Wordpress Beyond A Blog Word Camp Toronto08
Wordpress Beyond A Blog Word Camp Toronto08Wordpress Beyond A Blog Word Camp Toronto08
Wordpress Beyond A Blog Word Camp Toronto08Jamie Oastler
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...
Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...
Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...Scott DeLoach
 
It’s a blog. it’s a website.
It’s a blog. it’s a website.It’s a blog. it’s a website.
It’s a blog. it’s a website.Css Founder
 
Practical Blogs for Writers
Practical Blogs for WritersPractical Blogs for Writers
Practical Blogs for WritersSusan Stewart
 
Dreamweaver Course2006 Week1
Dreamweaver Course2006 Week1Dreamweaver Course2006 Week1
Dreamweaver Course2006 Week1Rod Nicholls
 
Selecting A Content Management System
Selecting A Content Management SystemSelecting A Content Management System
Selecting A Content Management SystemNew Marketing Labs
 
Building a Simple, Responsive Website with ExpressionEngine
Building a Simple, Responsive Website with ExpressionEngineBuilding a Simple, Responsive Website with ExpressionEngine
Building a Simple, Responsive Website with ExpressionEngineOttergoose
 
WordPress How To by Sherif Morgan
WordPress How To by Sherif MorganWordPress How To by Sherif Morgan
WordPress How To by Sherif MorganOnlineBizSmarts.com
 
Prabhanjan Panigrahi
Prabhanjan PanigrahiPrabhanjan Panigrahi
Prabhanjan PanigrahiAnirban Saha
 
Benefits of the CodeIgniter Framework
Benefits of the CodeIgniter FrameworkBenefits of the CodeIgniter Framework
Benefits of the CodeIgniter FrameworkToby Beresford
 
Learn html and css from scratch
Learn html and css from scratchLearn html and css from scratch
Learn html and css from scratchMohd Manzoor Ahmed
 

Similar to WordPress - Create Custom Post Types (20)

Test ss 1
Test ss 1Test ss 1
Test ss 1
 
Wordpress Beyond A Blog Word Camp Toronto08
Wordpress Beyond A Blog Word Camp Toronto08Wordpress Beyond A Blog Word Camp Toronto08
Wordpress Beyond A Blog Word Camp Toronto08
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
WordPress 101
WordPress 101WordPress 101
WordPress 101
 
Lecture7
Lecture7Lecture7
Lecture7
 
Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...
Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...
Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...
 
Open Source CMS
Open Source CMSOpen Source CMS
Open Source CMS
 
It’s a blog. it’s a website.
It’s a blog. it’s a website.It’s a blog. it’s a website.
It’s a blog. it’s a website.
 
Killer word press-checklist
Killer word press-checklistKiller word press-checklist
Killer word press-checklist
 
Wordpress as a CMS
Wordpress as a CMSWordpress as a CMS
Wordpress as a CMS
 
Drupal SEO
Drupal SEODrupal SEO
Drupal SEO
 
Practical Blogs for Writers
Practical Blogs for WritersPractical Blogs for Writers
Practical Blogs for Writers
 
Dreamweaver Course2006 Week1
Dreamweaver Course2006 Week1Dreamweaver Course2006 Week1
Dreamweaver Course2006 Week1
 
Selecting A Content Management System
Selecting A Content Management SystemSelecting A Content Management System
Selecting A Content Management System
 
Building a Simple, Responsive Website with ExpressionEngine
Building a Simple, Responsive Website with ExpressionEngineBuilding a Simple, Responsive Website with ExpressionEngine
Building a Simple, Responsive Website with ExpressionEngine
 
WordPress How To by Sherif Morgan
WordPress How To by Sherif MorganWordPress How To by Sherif Morgan
WordPress How To by Sherif Morgan
 
Prabhanjan Panigrahi
Prabhanjan PanigrahiPrabhanjan Panigrahi
Prabhanjan Panigrahi
 
Benefits of the CodeIgniter Framework
Benefits of the CodeIgniter FrameworkBenefits of the CodeIgniter Framework
Benefits of the CodeIgniter Framework
 
Learn html and css from scratch
Learn html and css from scratchLearn html and css from scratch
Learn html and css from scratch
 
WordCamp Denmark Keynote
WordCamp Denmark KeynoteWordCamp Denmark Keynote
WordCamp Denmark Keynote
 

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

WordPress - Create Custom Post Types

  • 1. Creating Custom Post Types UCF Marketing Brandon Groves webcom@ucf.edu http://www.slideshare.net/DFieldFL/wordpress-create-custom-post-types
  • 2. Outline  UCF Marketing background  What are custom post types (CPTs)  How to create a CPTs  How to display CPTs  How we (SMCA) create CPTs  Conclusion  Questions/Comments
  • 3. UCF Marketing background Web Development Team  Roger Wolf  Jo Greybill  Brandon Groves Been using WordPress for 5 Years Develop ~12 sites a year Sites we developed using WordPress  http://www.ucf.edu  http://today.ucf.edu  http://pegasus.ucf.edu  http://hr.ucf.edu  http://hospitality.ucf.edu
  • 4. What are custom post types (CPTs) Most content uses post types [1]  Posts  Pages  Navigation Menu  Attachment  Revision CPT [1] http://codex.wordpress.org/Post_Types#Custom_Post_Types
  • 5. A way of organizing content  Announcements  People  Documents Add custom data  Meta data  Featured image  Taxonomies Remove fields  Title  Content Meta data
  • 6.  When creating CPTs you have to also create a way of displaying them  CPTs are NOT displayed anywhere by default (except via single.php)
  • 7. Has anyone used custom post types? Other use-cases  http://www.bard.edu/ccs/  http://www.cec.fiu.edu/academics/bachelor/  http://www.nicholls.edu/admission/  http://pegasus.ucf.edu/
  • 8. How to create CPTs Selling ACME products  List all product that are sold  Individual product page with descriptions Resources  http://codex.wordpress.org/Post_Types  http://codex.wordpress.org/Function_Refere nce/register_post_type  http://codex.wordpress.org/Plugin_API/Actio n_Reference
  • 9. Reserved Post Types [2]  post  page  attachment  revision  nav_menu_item Register CPT [2]  Post type ID (required)  Arguments – defining characteristics of the CPT [2] http://codex.wordpress.org/Function_Reference/register_post_type#Reserved_Post_Types
  • 10. Hook function into the workflow  Functions.php file is auto loaded [3]  Convenience method add_action [4] [5]  When to execute our code  What code to execute  Priority compared to other added actions  Arguments [3] http://codex.wordpress.org/Theme_Development#Functions_File [4] http://codex.wordpress.org/Function_Reference/add_action [5] http://codex.wordpress.org/Plugin_API/Action_Reference
  • 12. CPT displays on left menu  Displays posts  Add new post A CPT by default looks the same as Post  Title  Content/Body
  • 13. How to display CPTs Create products  Anvil  Giant Rubber Band
  • 14. Where are our products?
  • 15. Template structure [6]  A single page to display products  Pages are automatically put into the menu  page-{slug}.php filename  Content title is used for the slug [6] http://codex.wordpress.org/Template_Hierarchy
  • 16. Creating our own display page
  • 17. Empty page  Defaults to page.php
  • 18. Create template  using the page slug file naming convention (page-products.php)  Querie our CPT of amce_products (The Loop) [7] [7] http://codex.wordpress.org/The_Loop The Loop
  • 20. View a product  Defaults to single.php [6] [6] http://codex.wordpress.org/Template_Hierarchy
  • 21. Create a custom display  Displaying single CTP (single-{post-type-id}.php) [6] [6] http://codex.wordpress.org/Template_Hierarchy
  • 22. Displaying single CTP (single-acme_product.php)
  • 23. How we (SMCA) create CPTs Resources  https://github.com/UCF/Wordpress-Generic-Theme Code  custom-post-types.php (Base CPT Class)
  • 24. Defining a new CPT (Document)  Inherit CustomePostType class  Modify variables if needed
  • 25. Defining a new CPT  Add custom functionality
  • 26. Enabling CPT (registering)  Add CPT class name to the Config’s custom_post_types array (functions/config.php)
  • 27. How we (SMCA) create CPTs
  • 28. Conclusion WordPress is more than a blogging tool CPTs help group like content CPTs are NOT displayed by default  Manually link to it  Create a display page listing CPTs (page templates)  Create unique single post display (post templates)