Advanced Custom Post Types
Upcoming SlideShare
Loading in...5
×
 

Advanced Custom Post Types

on

  • 1,812 views

My presentation at WordCamp San Diego 2013 about advanced methods of using custom post types and taxonomies.

My presentation at WordCamp San Diego 2013 about advanced methods of using custom post types and taxonomies.

Statistics

Views

Total Views
1,812
Views on SlideShare
1,812
Embed Views
0

Actions

Likes
3
Downloads
14
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Advanced Custom Post Types Advanced Custom Post Types Presentation Transcript

    • Advanced Custom Post Types & Taxonomies WordCamp San Diego 2013 #wcsd @theandystrattonSaturday, March 23, 13
    • Who am I?Saturday, March 23, 13
    • Freelance WordPress DeveloperSaturday, March 23, 13
    • FounderSaturday, March 23, 13
    • What are Custom Post Types?Saturday, March 23, 13
    • Generic Post Content Inherit core user interface & functionalitySaturday, March 23, 13
    • Including: Post meta, attachments, featured image, hierarchies, comments, etc.Saturday, March 23, 13
    • What are Custom Taxonomies?Saturday, March 23, 13
    • Generic Tags/CategoriesSaturday, March 23, 13
    • Taxonomies create relationships between contentSaturday, March 23, 13
    • Why should we use them?Saturday, March 23, 13
    • In the old days, we’d: Re-purpose blog posts filtering by category/tagSaturday, March 23, 13
    • In the old days, we’d: Create custom database tables and functionalitySaturday, March 23, 13
    • In the old days, we’d: Use strange plugins and non-standard codeSaturday, March 23, 13
    • This is pretty much doing it wrong.Saturday, March 23, 13
    • Why DO we custom post types/taxonomies?Saturday, March 23, 13
    • Future compatibleSaturday, March 23, 13
    • WordPress Coding StandardsSaturday, March 23, 13
    • Theme & Plugin compatibility (page ordering, SEO plugins, etc.)Saturday, March 23, 13
    • Flexible & Extendible Post Meta, attachments, hierarchies, ordering, featured imagesSaturday, March 23, 13
    • Help maintain a consistent user-interface & consistent user-experienceSaturday, March 23, 13
    • @alternatekev: “Build design systems.”Saturday, March 23, 13
    • For what can we use custom post types?Saturday, March 23, 13
    • Home Page SlidersSaturday, March 23, 13
    • Callout BoxesSaturday, March 23, 13
    • Photo GalleriesSaturday, March 23, 13
    • LocationsSaturday, March 23, 13
    • Job PostingsSaturday, March 23, 13
    • People/TeamsSaturday, March 23, 13
    • Reusable Static ContentSaturday, March 23, 13
    • HTML EmailsSaturday, March 23, 13
    • Let’s break these site elements down into CPT components.Saturday, March 23, 13
    • Callout BoxesSaturday, March 23, 13
    • Callout BoxesSaturday, March 23, 13
    • Callout Boxes imageSaturday, March 23, 13
    • Callout Boxes image contentSaturday, March 23, 13
    • Callout Boxes Element Post Type Element Image Featured Image Content Post Title/Content In post content, OR Link custom fieldSaturday, March 23, 13
    • Callout BoxesSaturday, March 23, 13
    • Callout BoxesSaturday, March 23, 13
    • Callout BoxesSaturday, March 23, 13
    • Callout BoxesSaturday, March 23, 13
    • Callout BoxesSaturday, March 23, 13
    • More Post Type MapsSaturday, March 23, 13
    • Photo Gallery Element Post Type Element Image Gallery Post Attachments Title Post Title Description Post Content Date Post DateSaturday, March 23, 13
    • People/Teams Element Post Type Element Photo Featured Image Person Name Post Title Description Post Content Additional Info Custom Fields/Post Meta (Title, Phone, etc.)Saturday, March 23, 13
    • This gives us some great benefits...Saturday, March 23, 13
    • Content Scheduling Use publish date and the Post Expirator plugin wordpress.org/extend/plugins/post-expirator/Saturday, March 23, 13
    • Content Staging Library Save callouts as drafts. Easily swap content with more options than text widgets.Saturday, March 23, 13
    • Benefits Case Study Marketing Sliders for Brick BodiesSaturday, March 23, 13
    • Marketing Team Anyone with publish capabilities can create, schedule and expire slides.Saturday, March 23, 13
    • Monthly Plans Plan their specials/events in advance Set their next month’s slides to publish when current expireSaturday, March 23, 13
    • WordPress Standards Consistent UI & user experience If a user can add/edit a post, they can add/edit a slideSaturday, March 23, 13
    • WordPress Standards Future compatible Compatible with plugins (e.g. post expirator)Saturday, March 23, 13
    • Enhancing the Core UISaturday, March 23, 13
    • Enhancing the Core UI We should add context to everything. Add logical elements to make managing content easier.Saturday, March 23, 13
    • Enter Title HereSaturday, March 23, 13
    • Easy Code https://gist.github.com/theandystratton/5225881Saturday, March 23, 13
    • Custom Menu IconsSaturday, March 23, 13
    • Custom Menu Icons https://gist.github.com/theandystratton/5226783Saturday, March 23, 13
    • Admin ColumnsSaturday, March 23, 13
    • Custom Columns https://gist.github.com/theandystratton/5225903Saturday, March 23, 13
    • Custom Column Content https://gist.github.com/theandystratton/5225903Saturday, March 23, 13
    • Saturday, March 23, 13
    • Make Great Experiences Meet user expectations (clicking the thumbnail edits the post) Show all relevant dataSaturday, March 23, 13
    • Taxonomy: Store Categories Can group/relate content Filter the edit screenSaturday, March 23, 13
    • Clicking Entertainment in the “Store Categories” column filters listing by locations tagged “Entertainment.”Saturday, March 23, 13
    • Saturday, March 23, 13
    • Using “show_admin_column” when registering a public taxonomy. gist.github.com/theandystratton/5226656Saturday, March 23, 13
    • Add Context with Taxonomies Case Study: Content TagsSaturday, March 23, 13
    • General Tags Applied to pages, posts and all custom post typesSaturday, March 23, 13
    • Create relationships across all post types Easily relate unrelated contentSaturday, March 23, 13
    • Example: LIIFund.orgSaturday, March 23, 13
    • Some pages are content about specific types of projects.Saturday, March 23, 13
    • Custom post type of “statistics” used to populate the left sidebar columnSaturday, March 23, 13
    • Client wants “Child Care” statistics to auto-populate in the sidebar of the child care pageSaturday, March 23, 13
    • Saturday, March 23, 13
    • PageSaturday, March 23, 13
    • Page Custom Post TypeSaturday, March 23, 13
    • Used content tags to relate pages to statistics & pull programmatically.Saturday, March 23, 13
    • Saturday, March 23, 13
    • Saturday, March 23, 13
    • wp_dropdown_categories()Saturday, March 23, 13
    • These content tags allow users to tag content and we can use it to provide contextual content.Saturday, March 23, 13
    • https://gist.github.com/theandystratton/5226712Saturday, March 23, 13
    • https://gist.github.com/theandystratton/5226712Saturday, March 23, 13
    • You can pair content tags (a generic taxonomy) with content blocks (a generic post type) to rapidly deploy all sorts of contextual content management.Saturday, March 23, 13
    • Content Blocks https://github.com/szbl/szbl-content-blocks/ Content Tags https://github.com/szbl/szbl-content-tags/Saturday, March 23, 13
    • Be Extendible! Think Like Core. Be Like Core.Saturday, March 23, 13
    • Hooks Do Actions. Apply Filters.Saturday, March 23, 13
    • What if I want to hide the admin column and only apply these to pages and posts?Saturday, March 23, 13
    • We can hook into Content Tags like this:Saturday, March 23, 13
    • Truly Extendible. You can customize code. You can re-use code.Saturday, March 23, 13
    • Your plugins folder may look like this:Saturday, March 23, 13
    • Your plugins folder may look like this: This plugin...Saturday, March 23, 13
    • Your plugins folder may look like this: This plugin... Modifies these pluginsSaturday, March 23, 13
    • Truly Extendible. You can customize code. You can re-use code.Saturday, March 23, 13
    • Saves time. Saves money. Updates are easier. Functionality is not tethered to a theme.Saturday, March 23, 13
    • Some Final DOs & DON’TsSaturday, March 23, 13
    • DON’T Alter/change core user-interface (CSS, Javascript, core hacks)Saturday, March 23, 13
    • DON’T Re-brand WordPress as your own custom CMS. (You’re not fooling anyone.)Saturday, March 23, 13
    • DON’T Use custom tables or database queries when it is not necessary. (In most cases, it’s not.)Saturday, March 23, 13
    • DON’T Forget about widgets, sidebars and menus.Saturday, March 23, 13
    • DON’T Overcomplicate Shit. (Complicate shit when shit gets complicated.)Saturday, March 23, 13
    • DO Use the Core UISaturday, March 23, 13
    • DO Create additional UI elements via Core CSS. Let core inspire you.Saturday, March 23, 13
    • DO Place your code into plugins. Even custom themes need plugin love.Saturday, March 23, 13
    • DO Constantly improve your code.Saturday, March 23, 13
    • DO Re-use your code.Saturday, March 23, 13
    • DO Write extendible code. Use Actions and Filters.Saturday, March 23, 13
    • DO Share your code. WP.org/GitHub/Gist/your blogSaturday, March 23, 13
    • DO Be awesome. Love what you do. Do it well.Saturday, March 23, 13
    • Thanks for the time.Saturday, March 23, 13