Your SlideShare is downloading. ×
0
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
WordPress - Create Custom Post Types
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

WordPress - Create Custom Post Types

1,260

Published on

Explains wordpress custom posts types and how University of Central Florida's (UCF) Marketing web team creates custom post types.

Explains wordpress custom posts types and how University of Central Florida's (UCF) Marketing web team creates custom post types.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,260
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Creating Custom PostTypesUCF MarketingBrandon Groveswebcom@ucf.eduhttp://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 backgroundWeb Development Team Roger Wolf Jo Greybill Brandon GrovesBeen using WordPress for 5 YearsDevelop ~12 sites a yearSites 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 posttypes (CPTs)Most content uses post types [1] Posts Pages Navigation Menu Attachment RevisionCPT[1] http://codex.wordpress.org/Post_Types#Custom_Post_Types
  • 5. A way of organizing content Announcements People DocumentsAdd custom data Meta data Featured image TaxonomiesRemove fields Title ContentMeta data
  • 6.  When creating CPTs youhave to also create a way ofdisplaying them CPTs are NOT displayedanywhere 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 CPTsSelling ACME products List all product that are sold Individual product page with descriptionsResources http://codex.wordpress.org/Post_Types http://codex.wordpress.org/Function_Reference/register_post_type http://codex.wordpress.org/Plugin_API/Action_Reference
  • 9. Reserved Post Types [2] post page attachment revision nav_menu_itemRegister 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
  • 11. Code {theme}/functions.php
  • 12. CPT displays on left menu Displays posts Add new postA CPT by default looks thesame as Post Title Content/Body
  • 13. How to display CPTsCreate 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_LoopThe Loop
  • 19. Products page
  • 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 CPTsResources https://github.com/UCF/Wordpress-Generic-ThemeCode 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_typesarray (functions/config.php)
  • 27. How we (SMCA) create CPTs
  • 28. ConclusionWordPress is more than a blogging toolCPTs help group like contentCPTs are NOT displayed by default Manually link to it Create a display page listing CPTs (page templates) Create unique single post display (post templates)
  • 29. Questions?http://www.slideshare.net/DFieldFL/wordpress-create-custom-post-typesContact: webcom@ucf.edu

×