Multiple Content Types
• Pages
– Main site pages
– Apply templates for advanced functionality
– Are hierarchical (can have parent/child relationships)
• Posts
– Flexible for any content, anywhere
– Tags and categories allow content segmentation
– Not hierarchical
• Custom Post Types
– Provide a separate interface for totally custom content
– Create if default Posts are in use already (ie. a blog)
– OR for highly special content that doesn’t fit normal post
schema (home page slider)
– Can be hierarchical, but are not by default
Page Templates
• Used when layout or functionality doesn’t
match the rest of the theme and cannot be
added through the post editor
• Examples
– Highly specialized forms
– Precisely placed elements, like maps
– Single column instead of theme’s regular two
– Specific scripts only needed on that page
– Other special layouts
– Members-only or other protected areas
Implementing Page Templates
• Two main ways
– From Page Editor
• Works only for Pages
• End-user is able to change
– With get_template_part() and a conditional
statement
• Done on a theme level
• Provides way to get any template from anywhere, even
if it’s just a small piece (like social media links or a
gallery)
Post Tags and Categories
• Both provide a way to group and navigate content
• Both are searchable and form archive pages by default
• Categories
– Umbrella groups for similar content topics
– Are hierarchical (can have parent/child relationships)
– Use to separate content but still use the default post editor
• Tags
– Like keywords
– Especially useful for blogs to connect topics
– Also useful for ecommerce
• Analogy for Use
– A book store would categorize by genre, but tag each book
with the author
Custom Taxonomies
• Categories and Tags are “taxonomies”
• Custom Taxonomies essentially work the
same, but are more easily distinguishable
• Book Store Example
– “Genre” would be a custom taxonomy instead of
using the default categories
– “Author” would be created instead of using tags
Custom Post Types (CPT)
• Useful to make specialized content readily
accessible to end-users
• Can be made inaccessible by search, and
therefore be used to insert and organize small
bits of content
– Example: Sliders
• Only include the interface elements needed
– ie. only the Title, Editor, and Featured Image and
not Categories or Tags
Custom Fields
• Provide additional post meta for Posts or Pages
via customized UI elements
• Any form field can be used to get additional data
• How to Use
– DO use for variable data
– DO use to make content easier for end-user to edit
– DO use to insert content and retain theme styling
– DO NOT use when the data needs to form
relationships between posts/pages – use a taxonomy
instead
Custom Fields
• Favorite Uses
– Checkbox to mark as a featured post
– Radio to place in a specific area
– Checkboxes to add product features
– A series of rich-editor enabled textareas to add
content to a special layout (especially from CPT)
– Extra upload for specific media display/output
Creating CPT, Custom Taxonomies,
and Custom Fields
Demo of
Easy Custom Post Types
plugin
Plan for Next Sessions
• How to Get What You Want: Part I
– Basic theme tags
– The WordPress Loop, and how to Query
• How to Get What You Want: Part II
– Conditional Statements, Custom Fields, and get_template_part()
• Helping the End User Part I
– Shortcodes v. Custom Fields
• Helping the End User Part II
– Theme Options
• Plugins and Functions
– When to use
– Functionality plugins vs. functions.php
– Recommended plugins
• Defending Themes From End-Users
– Final setup of user accounts and training
Resources
• The WordPress Codex
– Your new best friend, so go get friendly
http://codex.wordpress.org/
• Pages
– http://codex.wordpress.org/Pages
– Page Templates
• Create basic template:
http://codex.wordpress.org/Pages#Creating_Your_Own_Pag
e_Templates
• Post Types
– About various post types
http://codex.wordpress.org/Post_Types
Resources
• Taxonomies
– Basics
http://justintadlock.com/archives/2010/06/10/a-
refresher-on-custom-taxonomies
– More on implementation
http://justintadlock.com/archives/2011/10/20/cu
stom-user-taxonomies-in-wordpress
Resources
• Taxonomies
– Basics
http://justintadlock.com/archives/2010/06/10/a-
refresher-on-custom-taxonomies
– More on implementation
http://justintadlock.com/archives/2011/10/20/cu
stom-user-taxonomies-in-wordpress
Resources
• Recommended RSS Feeds
– Link to my Google Reader xml file
(edit out one’s you already have, then import to
your reader)
http://dl.dropbox.com/u/26817239/stephs-
wordpress-rss.xml