Download - Structured Data in WordPress

Transcript
Page 1: Structured Data in WordPress

Structured Datain WordPressRandy Hoyt

Page 2: Structured Data in WordPress

@randyhoyt #wcto

Randy Hoyt randyhoyt.com

@randyhoyt

Presentation randyhoyt.com/wcto

About Me

Page 3: Structured Data in WordPress

@randyhoyt #wcto

WordPress Timeline

May 2003

WordPress Now Availablehttp://wordpress.org/news/2003/05/wordpress-now-available/

− Initial Release− Blog Posts

WordPress 0.7

2003 2005 2007 2009 2011 2013

Page 4: Structured Data in WordPress

@randyhoyt #wcto

WordPress Timeline

May 2004

− Randy’s first WordPress blog

WordPress 1.2

2003 2005 2007 2009 2011 2013

Page 5: Structured Data in WordPress

@randyhoyt #wcto

WordPress Timeline

Announcing WordPress 1.5http://wordpress.org/news/2005/02/strayhorn/

February 2005

− Pages− Custom Fields

WordPress 1.5

2003 2005 2007 2009 2011 2013

“The ‘pages’ feature allows you

to run your entire site through

WordPress.”

Page 6: Structured Data in WordPress

@randyhoyt #wcto

Page 7: Structured Data in WordPress

@randyhoyt #wcto

Page 8: Structured Data in WordPress

@randyhoyt #wcto

“Data that resides in fixed

fields within a record.

Contrast with unstructured

data.”

Structured Data

PC Magazine Encyclopedia: Structured Datahttp://r2h.me/pcmagdata

What is it?

Page 9: Structured Data in WordPress

@randyhoyt #wcto

Structured DataStructured Unstructured

Page 10: Structured Data in WordPress

@randyhoyt #wcto

WordPress Timeline

WordPress 3.0 “Thelonious”http://wordpress.org/news/2010/06/thelonious/

June 2010

− Custom Post Types

WordPress 3.0

2003 2005 2007 2009 2011 2013

Page 11: Structured Data in WordPress

@randyhoyt #wcto

1. Simple Adding / Editing

2. Complex Formatting

Structured DataWhy use it?

Page 12: Structured Data in WordPress

@randyhoyt #wcto

Page 13: Structured Data in WordPress

@randyhoyt #wcto

1. Simple Adding / Updating

2. Complex Formatting

3. Data Integrity

Structured DataWhy use it?

Page 14: Structured Data in WordPress

@randyhoyt #wcto

Page 15: Structured Data in WordPress

@randyhoyt #wcto

Page 16: Structured Data in WordPress

@randyhoyt #wcto

1. Ease of Adding & Updating

2. Complex Formatting

3. Data Integrity

4. Cross-Platform Delivery

Structured DataWhy use it?

Page 17: Structured Data in WordPress

@randyhoyt #wcto

Page 18: Structured Data in WordPress

@randyhoyt #wcto

Page 19: Structured Data in WordPress

@randyhoyt #wcto

Adapting Ourselves to Adaptive Contenthttp://www.slideshare.net/KMcGrane/adapting-ourselves-to-adaptive-content-12133365

Page 20: Structured Data in WordPress

@randyhoyt #wcto

Adapting Ourselves to Adaptive Contenthttp://www.slideshare.net/KMcGrane/adapting-ourselves-to-adaptive-content-12133365

Page 21: Structured Data in WordPress

@randyhoyt #wcto

Page 22: Structured Data in WordPress

@randyhoyt #wcto

Theme vs. Plugin

Custom Functionality Plugin

• Completely separated from theme

• Remains activated even theme is not

• Best for code related to functionality

Theme Functions File

(functions.php)

• Code is executed just like a plugin

• Activated (or deactivated) along with

the theme

• Best for code related to appearance

Where does this custom code belong?

How to create your own WordPress functionality pluginhttp://wpcandy.com/teaches/how-to-create-a-functionality-plugin

A common, yet unfortunate practice in the

WordPress community involves filling theme

functions.php files with tweaks and functionality

that is key to a site.”

Page 23: Structured Data in WordPress

@randyhoyt #wcto

Page 24: Structured Data in WordPress

@randyhoyt #wcto

Page 25: Structured Data in WordPress

@randyhoyt #wcto

WordPress Codex: Post Types > Custom Typeshttp://codex.wordpress.org/Post_Types#Custom_Types

Page 26: Structured Data in WordPress

@randyhoyt #wcto

Page 27: Structured Data in WordPress

@randyhoyt #wcto

Aptana, library uploaded, code for metaboxes

Page 28: Structured Data in WordPress

@randyhoyt #wcto

Page 29: Structured Data in WordPress

@randyhoyt #wcto

Custom Fields

wp_posts

ID post_type post_title

37 rrh_assignment Final Project

38 rrh_assignment Final Exam

wp_postmeta

post_id meta_key meta_value

37 date_due 12/07/2011

37 percentage 24

38 date_due 12/14/2011

38 percentage 16

Page 30: Structured Data in WordPress

@randyhoyt #wcto

Custom Fields

Page 31: Structured Data in WordPress

@randyhoyt #wcto

Three Ways to Customize the Interface

Tutorial: “Reusable Custom Meta Boxes”

http://r2h.me/wpreuseable

Plugin: Advanced Custom Fields

http://wordpress.org/extend/plugins/advanced-

custom-fields/

Library: Custom Meta Boxes

http://r2h.me/wpcmb

Custom Fields

Page 32: Structured Data in WordPress

@randyhoyt #wcto

Library: Custom Meta Boxeshttp://r2h.me/wpcmb

Custom Meta Boxes allow you to build clean,

understandable interfaces for entering metadata. There’s

a ton of field options: text, textarea, checkbox, dropdown

list, WYSIWYG, and more.

Page 33: Structured Data in WordPress

@randyhoyt #wcto

Page 34: Structured Data in WordPress

@randyhoyt #wcto

Add Custom Meta Boxes to Your Pluginhttp://randyhoyt.com/wordpress/custom-meta-boxes-plugin/

Page 35: Structured Data in WordPress

@randyhoyt #wcto

Add Custom Meta Boxes to Your Pluginhttp://randyhoyt.com/wordpress/custom-meta-boxes-plugin/

Page 36: Structured Data in WordPress

@randyhoyt #wcto

Page 37: Structured Data in WordPress

@randyhoyt #wcto

Page 38: Structured Data in WordPress

@randyhoyt #wcto

Video, show fields, add values, save

Page 39: Structured Data in WordPress

@randyhoyt #wcto

Screenshot of dashboard, all assignments added

Ordering WordPress Post Types By A Custom Fieldhttp://randyhoyt.com/wordpress/custom-post-type-ordering/

Page 40: Structured Data in WordPress

@randyhoyt #wcto

Page 41: Structured Data in WordPress

@randyhoyt #wcto

Page 42: Structured Data in WordPress

@randyhoyt #wcto

Page 43: Structured Data in WordPress

@randyhoyt #wcto

Page 44: Structured Data in WordPress

@randyhoyt #wcto

Page 45: Structured Data in WordPress

@randyhoyt #wcto

Page 46: Structured Data in WordPress

@randyhoyt #wcto

WordPress Codex: Template Hierarchyhttp://codex.wordpress.org/Template_Hierarchy

Page 47: Structured Data in WordPress

@randyhoyt #wcto

Child Theme Architecture

A WordPress child theme is a theme that

inherits the functionality of another theme,

called the parent theme, and allows you to

modify or add functionality.

Making a child theme is very simple. Create a

directory, put a properly formatted style.css

file in it, and you have a child theme!

WordPress Codex: Child Themeshttp://codex.wordpress.org/Child_Themes

Page 48: Structured Data in WordPress

@randyhoyt #wcto

Page 49: Structured Data in WordPress

@randyhoyt #wcto

Page 50: Structured Data in WordPress

@randyhoyt #wcto

Page 51: Structured Data in WordPress

@randyhoyt #wcto

Page 52: Structured Data in WordPress

@randyhoyt #wcto

Page 53: Structured Data in WordPress

@randyhoyt #wcto

Page 54: Structured Data in WordPress

@randyhoyt #wcto

Page 55: Structured Data in WordPress

@randyhoyt #wcto

Page 56: Structured Data in WordPress

@randyhoyt #wcto

Page 57: Structured Data in WordPress

@randyhoyt #wcto

Page 58: Structured Data in WordPress

@randyhoyt #wcto

Page 59: Structured Data in WordPress

@randyhoyt #wcto

1. Ease of Adding & Updating

2. Complex Formatting

3. Data Integrity

4. Cross-Platform Delivery

5. Logic-Based Automation

Structured DataWhy use it?

Page 60: Structured Data in WordPress

@randyhoyt #wcto

Shortcodes

When a shortcode is inserted in WordPress, it

is replaced with appropriate dynamic content

produced by a PHP function.

Let’s say we want to show the most recent

posts in a given post. We could use something

like this:

[recent-posts]

Smashing Magazine: WordPress Shortcodeshttp://r2h.me/wpshortcodes

Page 61: Structured Data in WordPress

@randyhoyt #wcto

Page 62: Structured Data in WordPress

@randyhoyt #wcto

Page 63: Structured Data in WordPress

@randyhoyt #wcto

Page 64: Structured Data in WordPress

@randyhoyt #wcto

Page 65: Structured Data in WordPress

@randyhoyt #wcto

Page 66: Structured Data in WordPress

@randyhoyt #wcto

Page 67: Structured Data in WordPress

@randyhoyt #wcto

CSV Importerhttp://wordpress.org/extend/plugins/csv-importer/

Page 68: Structured Data in WordPress

Randy Hoyt randyhoyt.com

@randyhoyt

Presentation randyhoyt.com/wcto

#wcto

Structured Datain WordPress