19

Premeditated Architectural Bliss: Post Types, Taxonomies, [Advanced] Custom Fields

Embed Size (px)

Citation preview

I’m RileyFreelance Full-Stack WP Dev based around Indianapolis 100% Night Owl Themes are where it’s at! (And plugins here and there.) #WP Slack + Trac Lurker Days: Design Tech Mentor – I have 60+ hirable students…

Quick Survey

Goals of a Well-Architected WP SiteFoolproof for the Client

100% Editable via the Admin Reduce/Eliminate Data Repetition Separation of Concerns Easier Future Feature Growth

What this Means for “Us”No more shoehorning everything into “Posts”

The data structure matches Your site Consistency in Markup/Code Easier Migrations and Theme Changes

What this Means for “Them”Guided Data Entry Stress Relief More time to focus on content

3 Components to Build OnAll WP Built-Ins!

POST TYPES – the structure

Distinct types of content that have many unique entries post

pageevent

moviebook

employee portfolio

artifact

member

product

recipe

artwork

flower

planet

Ancillary WP Defaultsattachment

revision nav_menu_item

action order theme

TAXONOMIES – the organization

category

post_tagta

xono

mies{ genre

metal

bebop

techpolitics love

android

Organizational pockets used to group “post” entries together

Reserved Names!author

calendar day

name page post

theme

{

terms

POST META – the data

Pieces of info about a “post” entry beyond the standard WP data

post_id meta_key meta_value315 email [email protected] email [email protected] twitter @devtricks123

981 website http://company.com

981 twitter @company

315 phone 555-555-5555

Note:This can contain serialized data, which is a common

tactic employed by plugins like ACF.

POST META

TAXONOMIES

POST TYPE“employee”

“employee_group”

“job_title” “phone” “email”

“birthday” “twitter”

YEAR (tax)

CHEFS“name” “photo”

“job_title” “company”

“bio” “twitter” “recipe”

“donation_url”

RECIPE“name”

“description” “instructions” “ingredients”

» quantity « » units « » item «

TEAM (tax)

AUCTION“name” “photo”

“description” “retail_value” “sale_price”

CAROUSEL“name” “image”

“link” “cta_text”

COURSE (tax)Flamin’ Spatulas, Grill Gods, etc. Salad, Entree, Dessert, etc. 2015, 2016, etc.

Charity Dinner/Auction Blueprint

Ways to Implement Architecture

register_post_type($settings); register_taxonomy($settings); update_post_meta($postID, $key, $value);

Hand-Crafted PHP

Generated PHPhttp://generatewp.com/

Ways to Implement Architecture (cont.)

Custom Post Type UI (CPTUI) Advanced Custom Fields (ACF)

Pro (Paid) available, but not today …tons of alternatives…

Plugins (Open-Source, of course)

Ways to Display the DataUse shortcodes provided by ACF

[acf field=“field_name"] (in the post content) [acf field="field_name" post_id=“123"]

Custom Content Shortcode plugin Use a Child Theme and edit the PHP templates

Child Theme Custom Loop

Full List of PluginsCustom Post Type UI – post types & taxonomies Advanced Custom Fields – custom post_meta Custom Content Shortcode – “loop” shortcodes Orbisius Child Theme Creator – child theme editing Admin Columns – add meta/taxs to admin listings

Questions?Riley Paulsen

@rileypaulsen