SlideShare a Scribd company logo
Content-Driven
WordPress Development
Stephanie Eckles @5t3ph thinkdobecreate.com
WordPress Is:
• An extremely flexible CMS
• An easily modifiable database
• A strong foundation to jump-start projects
• A growing app platform
• ...Sometimes a blog
Can WordPress
do X?
Presentation Goals
• See how a content-first development
approach looks
• Review how WordPress displays and relates
content
• Design a structure that supports content-
first development
Customizing WordPress
requires a
content-first
approach
Benefits of
Content-First Development
• More productive discussions with
content writers
• Better understanding of the site
architecture by designers
• Speedier sites
• More efficient queries
• Less confusion for the end user
Content-Driven WordPress Development - WordCamp Omaha 2014
What is the relationship of
this content to the rest of
the project?
A Simple Example:
Blog Considerations
• Categories
• Tags
• Handle multiple authors
• Have related sidebar content
For successful
content-first development,
all possibilities for
content relationships
are identified up-front.
What events would
cause this piece of
content to be
modified?
Dynamic Sidebar
• Dynamic sidebar content will be related
posts widget
• Related posts are based on matching the
category
• They are ordered with the newest first,
displaying up to 5
• They should exclude the current post
Content-driven
development means being
very purposeful in
choosing the mechanisms
for data entry.
Typical Marketing Website Needs
• Unique front page
• Non-central blog page
• Multi-level navigation
• Multiple menus (header, footer, sitemap)
• Resources section with press releases,
case studies, and white papers
• Lead generation forms
• Landing pages for services
• Search
How WordPress
Handles Content
Index vs. Home vs.
Front-Page
Remnants from
HTML Development
• index.html - default page rendered
- www.site.com/ > loads > www.site.com/index.html
• "Index" equates both "Home" and "Front
Page" for the root site
WordPress: Index, Home,
and Front Page
= 3 Different Use Cases
index.php
• The lowest-tier default template used if no
unique templates exist above it in the template
hierarchy (we'll circle back to that)
• Can be both the home and front page IF there
is no intention to make the front page unique
- Or if you want to deal with a crazy mess of
conditionals
home.php
• Relic of WordPress being a largely blog
platform
• Template for posts if either:
1. Front page settings of site is set to show latest
posts
2. Blog is non-central to the site's focus (i.e. not the
"home" page)
• Then set a different published Page as the "Posts"
page under Settings > Reading
front-page.php
• If this exists in a theme, will be first
priority to be used to display the site's front
page, regardless if latests posts or a static page
is chosen
• "Front page" static page can be defined under
Settings > Reading
Content-Driven WordPress Development - WordCamp Omaha 2014
Front Page Dictated
By Site's Purpose
WordPress As A Blog
• Create a unique home.php
• Leave default Reading settings to
display latest posts
WordPress For A Business
• Create unique front-page.php
• Publish a "Home" page
• Define the "Home" page as the front page
under Reading settings
WordPress For A
Business With a Blog
• Create unique front-page.php and unique
home.php
• Publish a "Home" page
• Publish a "Blog" page
• Define the "Home" page as the front page
under Reading settings
• Define the "Blog" page as the posts page
under Reading settings
#DoingItWrong
• Not define the front and posts pages
• Create your "home" page template on index.php
• Create a custom page template and write an
unnecessary query to create a paginated blog
template
Any Questions on
Index vs. Home vs.
Front Page?
Posts v. Pages
Posts
• Date-based
• Use categories
• Displayed in RSS feed
• Generally for blog or
news articles
Template hierarchy in
priority order:
- single-posttype.php
(we'll get to that)
- single.php
- index.php
Pages
• Generally static
• No categories or
tags
• Hierarchal (can
define parent and
child relationships)
• Usually top-level
content for non-
blog focused sites
Template hierarchy in
priority order:
- Custom template chosen
from Page Attributes
- page-pageslug.php
- page-id.php
- page.php
- index.php
Custom Meta
Benefits of
Custom Meta Data
• Can be any key/value pair
• Can be displayed automatically in a way
dictated by the theme
• Can be used to affect the main query
Greatest Benefit of
Custom Meta Data
• Can be entered via a custom-created meta
box on the edit screen of any post type
• Allows for precise data entry due to
constraints of the form field chosen
• Finer control over display or use
information within the theme
- Example:A meta box for a call-to-action
button would have a text field for the url and a
text field for the button text
Content-Driven WordPress Development - WordCamp Omaha 2014
Custom Post Types
Custom Post Type Benefits
• Customize URL structure
- site.com/**posttype**/post-slug/
• Can be excluded from search and nav menu selection
- Useful for: using entries as slide content in a carousel
• Can prevent inclusion in front-end queries
- Useful for: a documentation index displayed only in admin
Custom Post Type Benefits
• Limit UI elements on edit page
- Useful for: only showing the title, excerpt, and featured
image to create an image carousel with non-html captions
• Can define menu placement and structure for admin
- Useful for: grouping related CPTs, such as for a Resources
section
• More clearly defined area to edit particular content
- Meaning less calls and emails of "how do I change this?
CPT Location:
Theme or Plugin?
Marketing Site Example
• Resources Section
- Press releases
- Case studies
- White papers
Content-First Considerations:
• What information is related to each unique
content entry
• What is displayed for each entry on the
main resources page
• What is displayed on the single view for
each entry
• Special circumstances for viewing content
• How to make the content easily
maintainable by the end user
Content Considerations
For Each Type
• Title
• Full Content / Description
• Document download
• Special Content Case
- Newsletter Issue Archives
Resource PageView
Considerations
• Title
• Excerpt
• "Read More" link
Single ResourceView
Considerations
• Title
• Full Content
• Access to document
download
- Button for direct
download
• List of other recent
resources of same
type
Preparing for Content
• Determine content entry UI elements
- Title
- Editor
- Excerpt
- Meta Box
• Upload field for a document download
- Unique Feature
• A way to link "Issues" for the newsletter CPT
Preparing for Content
• Setup a CPT for each resource type
- Benefits:
• Pretty URL: site.com/case-study/name-of-case-study/
• Archive page generation
• More obvious editing access for end user
• Can target edit screen by post type for including
additional meta boxes and taxonomies
Custom Taxonomies
• Category-like capabilities
- Can also function like tags if no hierarchy needed or
multiples chosen per post
• Archive page generation
• Easy method to focus queries around
• Can be added to any post type - and even to
users!
Taxonomy vs. Meta Box
• Taxonomies are for grouping things
categorically.
• Meta boxes are for data that is customized
per post.
Content-Driven WordPress Development - WordCamp Omaha 2014
Content Structure:
Page Templates
• page-resources.php
- Pro: Easily identified in our theme structure
- Con: Loses association if a content editor
changes the slug
• template-resources.php
- Pro: Keeps association regardless of slug
- Con: Could be applied to other pages by
content editors less familiar with the site's
architecture
CPTs And Custom
Taxonomies In
Action!
Basic WP_Query $args For Each
Resource Page Section Loop
$args = array(
'post_type' => 'case_study',
'posts_per_page' => 10
)
);
Adding the Issues Taxonomy
To Newsletters
$args = array(
'post_type' => 'newsletter',
'posts_per_page' => 10,
'tax_query' => array(
array(
'taxonomy' => 'issues',
'field' => 'slug',
'terms' => 'spring-2014'
)
)
);
Content-Driven WordPress Development - WordCamp Omaha 2014
Content Structure:
SingleView
<?php while ( have_posts() ) : the_post(); ?>
/* Line of awesome */
<?php get_template_part( 'content', get_post_type() ); ?>
/* pagination & comments */
<?php endwhile; // end of the loop. ?>
get_template_part()
For A Case Study
get_template_part( 'content', get_post_type() );
==
get_template_part( 'content', 'case_study' );
==
include 'content-case_study.php';
Conditional Inclusion
<?php while ( have_posts() ) : the_post(); ?>
<?php
if( 'case_study' == get_post_type() || 'white_paper' == get_post_type() ) {
get_template_part( 'content', 'document' );
} else {
// i.e. 'post' or 'newsletter'
get_template_part( 'content', get_post_type() );
}
?>
/* pagination & comments */
<?php endwhile; // end of the loop. ?>
Conditional Sidebar
$resource_cpts = array('case_study', 'white_paper', 'newsletter');
if( in_array( get_post_type(), $resource_cpts) ) {
get_sidebar('resources');
} else {
// For single blog posts
get_sidebar();
}
Resources Content Structure Recap
• Create a CPT for each resource type
• Create a custom taxonomy for newsletter issues
• template-resources.php
- Three tidy queries to show each of our resource types
Resources Content Structure Recap
• single.php
- Keep a tidy loop with a simple conditional and
get_template_part()
• Create two content templates
- content-document.php for both case studies and
white papers
- content-newsletters.php for... newsletters
Applied Benefits Of
Content-First Development
• Conclude that three CPTs are needed
• Find that users would benefit from a meta box and
custom taxonomy
• Know to create one unique template:
- template-resources.php
Applied Benefits Of
Content-First Development
• Know to prepare UI elements for two content
parts:
1.content-document.php
2.content-newsletters.php
• Can note template files as wireframe notes for
designers
• Know that your end user will be able to find, edit,
and create new content easily!
In Conclusion...
A content-first development
approach to WordPress makes for:
A content-first development
approach to WordPress makes for:
• cleaner themes
A content-first development
approach to WordPress makes for:
• cleaner themes
• less back-tracking and exclamations of
"oh yeah, we need to do this!"
A content-first development
approach to WordPress makes for:
• cleaner themes
• less back-tracking and exclamations of
"oh yeah, we need to do this!"
• happier end users
A content-first development
approach to WordPress makes for:
• cleaner themes
• less back-tracking and exclamations of
"oh yeah, we need to do this!"
• happier end users
•happier you
Q&A Time!
Stephanie Eckles @5t3ph thinkdobecreate.com
Q&A Time!
Stephanie Eckles @5t3ph thinkdobecreate.com

More Related Content

PDF
seo - on page - part iv - link structure
KEY
Open Source CMS Playroom
PPTX
Search Engine Optimization - The eye-opening presentation for beginners
PPTX
Castro Chapter 3
PPTX
MCC Web Design Workshop
PPTX
Understanding SharePoint Content Types
PPTX
Copywriting for seo
seo - on page - part iv - link structure
Open Source CMS Playroom
Search Engine Optimization - The eye-opening presentation for beginners
Castro Chapter 3
MCC Web Design Workshop
Understanding SharePoint Content Types
Copywriting for seo

What's hot (20)

PPTX
A11y Conference Talk: Building an Accessible WordPress Theme
PPTX
EVOLVE'13 | Enhance | Effective SEO | Paul Legan
PPTX
Introduction to Custom WordPress Themeing
PPTX
Technical SEO Introduction
PPTX
Integrating Search Driven Content in SharePoint 2013/2016/O365
PPT
Open Source CMS
PDF
SharePoint 2013 Search Driven Sites - SPSHOU
PPT
Wordpress template hierarchy
PPTX
کارگاه سئو
PPT
Search engine optimization,Best SEO institute in Ghaziabad,SEO Courses in Gha...
PDF
SEO for Developers
PPT
Search Engine Optimization courses in ghaziabad, Search engine Optimization t...
PPTX
On page SEO
PPTX
Webiny CMS Starter Guide
PDF
Wordpress beyond blogging
PPTX
Content query web part – get it all in one place and style it!
PPTX
SharePoint 2013 Content search web part - Get it all in one place and style it!
PPTX
HTML Start Up - Introduction to HTML
PDF
Frontend for developers
PPTX
SharePoint Saturday Utah 2015 - SP2013 Search Driven Sites
A11y Conference Talk: Building an Accessible WordPress Theme
EVOLVE'13 | Enhance | Effective SEO | Paul Legan
Introduction to Custom WordPress Themeing
Technical SEO Introduction
Integrating Search Driven Content in SharePoint 2013/2016/O365
Open Source CMS
SharePoint 2013 Search Driven Sites - SPSHOU
Wordpress template hierarchy
کارگاه سئو
Search engine optimization,Best SEO institute in Ghaziabad,SEO Courses in Gha...
SEO for Developers
Search Engine Optimization courses in ghaziabad, Search engine Optimization t...
On page SEO
Webiny CMS Starter Guide
Wordpress beyond blogging
Content query web part – get it all in one place and style it!
SharePoint 2013 Content search web part - Get it all in one place and style it!
HTML Start Up - Introduction to HTML
Frontend for developers
SharePoint Saturday Utah 2015 - SP2013 Search Driven Sites
Ad

Viewers also liked (12)

PPTX
Zero Hour Directions vocab unit 1
PPTX
L'effet d'attendre
PPTX
Lathalain 140810210720-phpapp01
PPTX
Peer Effects
PPTX
Anchoring and Adjustment in Behavioral Economics
PPTX
Counting Revocable Planned Gifts in Fundraising - Return from Fantasy Island
PPTX
Sociology Peer Pressure
PPT
Peer Groups
PPTX
Peer pressure presentation
PPT
Student Project: Go Green
PPT
Student Project: Peer Pressure
PPTX
Pagtuturo ng filipino (1)
Zero Hour Directions vocab unit 1
L'effet d'attendre
Lathalain 140810210720-phpapp01
Peer Effects
Anchoring and Adjustment in Behavioral Economics
Counting Revocable Planned Gifts in Fundraising - Return from Fantasy Island
Sociology Peer Pressure
Peer Groups
Peer pressure presentation
Student Project: Go Green
Student Project: Peer Pressure
Pagtuturo ng filipino (1)
Ad

Similar to Content-Driven WordPress Development - WordCamp Omaha 2014 (20)

PPTX
The WordPress University 2012
PPTX
The Flexibility of WordPress
PPT
Building a Simple, Responsive Website with ExpressionEngine
PPTX
Wordpress overview
PPTX
WordPress Template hierarchy
PPT
WordPress Complete Tutorial
PPTX
The WordPress University
PPTX
Starting WordPress Theme Review
PDF
Newbies guide to customizing word press themes 25
PPTX
Basic word press development
KEY
WordPress - Open Source Overview Presentation
PPT
Word press interview question and answer tops technologies
KEY
WordPress can do that?!
PDF
Theming in WordPress - Where do I Start?
PPTX
Keeping Your Themes and Plugins Organized.
PPTX
Wordpress theme development
PPTX
WordPress Webinar Training Presentation
PPTX
PDF
Best Practices for Building Sites in dotCMS
PPTX
advance theme development
The WordPress University 2012
The Flexibility of WordPress
Building a Simple, Responsive Website with ExpressionEngine
Wordpress overview
WordPress Template hierarchy
WordPress Complete Tutorial
The WordPress University
Starting WordPress Theme Review
Newbies guide to customizing word press themes 25
Basic word press development
WordPress - Open Source Overview Presentation
Word press interview question and answer tops technologies
WordPress can do that?!
Theming in WordPress - Where do I Start?
Keeping Your Themes and Plugins Organized.
Wordpress theme development
WordPress Webinar Training Presentation
Best Practices for Building Sites in dotCMS
advance theme development

Recently uploaded (20)

PDF
Mastering Social Media Marketing in 2025.pdf
PDF
Presence That Pays Off Activate My Social Growth
PPTX
Office Administration Courses in Trivandrum That Employers Value.pptx
PDF
How can India improve its Public Diplomacy - Social Media.pdf
PPTX
Preposition and Asking and Responding Suggestion.pptx
PDF
The Edge You’ve Been Missing Get the Sociocosmos Edge
PDF
Medium @mikehydes The Cryptomaster About page
PPTX
Table Top Exercise (TTEx) on Emergency.pptx
PDF
11111111111111111111111111111111111111111111111
PDF
Medium @mikehydes The Cryptomaster Audience Stats
PDF
Medium @mikehydes The Cryptomaster Story Stats
PDF
Your Best Post Vanished. Blame the Attention Economy
PDF
A copy of a Medium article wishing Merry Christmas To All My Followers
PPTX
Types of Social Media Marketing for Business Success
PDF
Instant Audience, Long-Term Impact Buy Real Telegram Members
PDF
Create. Post. Dominate. Let's Build Together
PPTX
How Social Media Influencers Repurpose Content (1).pptx
PPTX
Strategies for Social Media App Enhancement
PDF
The Fastest Way to Look Popular Buy Reactions Today
PDF
Subscribe This Channel Subscribe Back You
Mastering Social Media Marketing in 2025.pdf
Presence That Pays Off Activate My Social Growth
Office Administration Courses in Trivandrum That Employers Value.pptx
How can India improve its Public Diplomacy - Social Media.pdf
Preposition and Asking and Responding Suggestion.pptx
The Edge You’ve Been Missing Get the Sociocosmos Edge
Medium @mikehydes The Cryptomaster About page
Table Top Exercise (TTEx) on Emergency.pptx
11111111111111111111111111111111111111111111111
Medium @mikehydes The Cryptomaster Audience Stats
Medium @mikehydes The Cryptomaster Story Stats
Your Best Post Vanished. Blame the Attention Economy
A copy of a Medium article wishing Merry Christmas To All My Followers
Types of Social Media Marketing for Business Success
Instant Audience, Long-Term Impact Buy Real Telegram Members
Create. Post. Dominate. Let's Build Together
How Social Media Influencers Repurpose Content (1).pptx
Strategies for Social Media App Enhancement
The Fastest Way to Look Popular Buy Reactions Today
Subscribe This Channel Subscribe Back You

Content-Driven WordPress Development - WordCamp Omaha 2014

  • 2. WordPress Is: • An extremely flexible CMS • An easily modifiable database • A strong foundation to jump-start projects • A growing app platform • ...Sometimes a blog
  • 4. Presentation Goals • See how a content-first development approach looks • Review how WordPress displays and relates content • Design a structure that supports content- first development
  • 6. Benefits of Content-First Development • More productive discussions with content writers • Better understanding of the site architecture by designers • Speedier sites • More efficient queries • Less confusion for the end user
  • 8. What is the relationship of this content to the rest of the project?
  • 9. A Simple Example: Blog Considerations • Categories • Tags • Handle multiple authors • Have related sidebar content
  • 10. For successful content-first development, all possibilities for content relationships are identified up-front.
  • 11. What events would cause this piece of content to be modified?
  • 12. Dynamic Sidebar • Dynamic sidebar content will be related posts widget • Related posts are based on matching the category • They are ordered with the newest first, displaying up to 5 • They should exclude the current post
  • 13. Content-driven development means being very purposeful in choosing the mechanisms for data entry.
  • 14. Typical Marketing Website Needs • Unique front page • Non-central blog page • Multi-level navigation • Multiple menus (header, footer, sitemap) • Resources section with press releases, case studies, and white papers • Lead generation forms • Landing pages for services • Search
  • 16. Index vs. Home vs. Front-Page
  • 17. Remnants from HTML Development • index.html - default page rendered - www.site.com/ > loads > www.site.com/index.html • "Index" equates both "Home" and "Front Page" for the root site
  • 18. WordPress: Index, Home, and Front Page = 3 Different Use Cases
  • 19. index.php • The lowest-tier default template used if no unique templates exist above it in the template hierarchy (we'll circle back to that) • Can be both the home and front page IF there is no intention to make the front page unique - Or if you want to deal with a crazy mess of conditionals
  • 20. home.php • Relic of WordPress being a largely blog platform • Template for posts if either: 1. Front page settings of site is set to show latest posts 2. Blog is non-central to the site's focus (i.e. not the "home" page) • Then set a different published Page as the "Posts" page under Settings > Reading
  • 21. front-page.php • If this exists in a theme, will be first priority to be used to display the site's front page, regardless if latests posts or a static page is chosen • "Front page" static page can be defined under Settings > Reading
  • 23. Front Page Dictated By Site's Purpose
  • 24. WordPress As A Blog • Create a unique home.php • Leave default Reading settings to display latest posts
  • 25. WordPress For A Business • Create unique front-page.php • Publish a "Home" page • Define the "Home" page as the front page under Reading settings
  • 26. WordPress For A Business With a Blog • Create unique front-page.php and unique home.php • Publish a "Home" page • Publish a "Blog" page • Define the "Home" page as the front page under Reading settings • Define the "Blog" page as the posts page under Reading settings
  • 27. #DoingItWrong • Not define the front and posts pages • Create your "home" page template on index.php • Create a custom page template and write an unnecessary query to create a paginated blog template
  • 28. Any Questions on Index vs. Home vs. Front Page?
  • 30. Posts • Date-based • Use categories • Displayed in RSS feed • Generally for blog or news articles Template hierarchy in priority order: - single-posttype.php (we'll get to that) - single.php - index.php
  • 31. Pages • Generally static • No categories or tags • Hierarchal (can define parent and child relationships) • Usually top-level content for non- blog focused sites Template hierarchy in priority order: - Custom template chosen from Page Attributes - page-pageslug.php - page-id.php - page.php - index.php
  • 33. Benefits of Custom Meta Data • Can be any key/value pair • Can be displayed automatically in a way dictated by the theme • Can be used to affect the main query
  • 34. Greatest Benefit of Custom Meta Data • Can be entered via a custom-created meta box on the edit screen of any post type • Allows for precise data entry due to constraints of the form field chosen • Finer control over display or use information within the theme - Example:A meta box for a call-to-action button would have a text field for the url and a text field for the button text
  • 37. Custom Post Type Benefits • Customize URL structure - site.com/**posttype**/post-slug/ • Can be excluded from search and nav menu selection - Useful for: using entries as slide content in a carousel • Can prevent inclusion in front-end queries - Useful for: a documentation index displayed only in admin
  • 38. Custom Post Type Benefits • Limit UI elements on edit page - Useful for: only showing the title, excerpt, and featured image to create an image carousel with non-html captions • Can define menu placement and structure for admin - Useful for: grouping related CPTs, such as for a Resources section • More clearly defined area to edit particular content - Meaning less calls and emails of "how do I change this?
  • 40. Marketing Site Example • Resources Section - Press releases - Case studies - White papers
  • 41. Content-First Considerations: • What information is related to each unique content entry • What is displayed for each entry on the main resources page • What is displayed on the single view for each entry • Special circumstances for viewing content • How to make the content easily maintainable by the end user
  • 42. Content Considerations For Each Type • Title • Full Content / Description • Document download • Special Content Case - Newsletter Issue Archives
  • 43. Resource PageView Considerations • Title • Excerpt • "Read More" link
  • 44. Single ResourceView Considerations • Title • Full Content • Access to document download - Button for direct download • List of other recent resources of same type
  • 45. Preparing for Content • Determine content entry UI elements - Title - Editor - Excerpt - Meta Box • Upload field for a document download - Unique Feature • A way to link "Issues" for the newsletter CPT
  • 46. Preparing for Content • Setup a CPT for each resource type - Benefits: • Pretty URL: site.com/case-study/name-of-case-study/ • Archive page generation • More obvious editing access for end user • Can target edit screen by post type for including additional meta boxes and taxonomies
  • 47. Custom Taxonomies • Category-like capabilities - Can also function like tags if no hierarchy needed or multiples chosen per post • Archive page generation • Easy method to focus queries around • Can be added to any post type - and even to users!
  • 48. Taxonomy vs. Meta Box • Taxonomies are for grouping things categorically. • Meta boxes are for data that is customized per post.
  • 50. Content Structure: Page Templates • page-resources.php - Pro: Easily identified in our theme structure - Con: Loses association if a content editor changes the slug • template-resources.php - Pro: Keeps association regardless of slug - Con: Could be applied to other pages by content editors less familiar with the site's architecture
  • 52. Basic WP_Query $args For Each Resource Page Section Loop $args = array( 'post_type' => 'case_study', 'posts_per_page' => 10 ) );
  • 53. Adding the Issues Taxonomy To Newsletters $args = array( 'post_type' => 'newsletter', 'posts_per_page' => 10, 'tax_query' => array( array( 'taxonomy' => 'issues', 'field' => 'slug', 'terms' => 'spring-2014' ) ) );
  • 55. Content Structure: SingleView <?php while ( have_posts() ) : the_post(); ?> /* Line of awesome */ <?php get_template_part( 'content', get_post_type() ); ?> /* pagination & comments */ <?php endwhile; // end of the loop. ?>
  • 56. get_template_part() For A Case Study get_template_part( 'content', get_post_type() ); == get_template_part( 'content', 'case_study' ); == include 'content-case_study.php';
  • 57. Conditional Inclusion <?php while ( have_posts() ) : the_post(); ?> <?php if( 'case_study' == get_post_type() || 'white_paper' == get_post_type() ) { get_template_part( 'content', 'document' ); } else { // i.e. 'post' or 'newsletter' get_template_part( 'content', get_post_type() ); } ?> /* pagination & comments */ <?php endwhile; // end of the loop. ?>
  • 58. Conditional Sidebar $resource_cpts = array('case_study', 'white_paper', 'newsletter'); if( in_array( get_post_type(), $resource_cpts) ) { get_sidebar('resources'); } else { // For single blog posts get_sidebar(); }
  • 59. Resources Content Structure Recap • Create a CPT for each resource type • Create a custom taxonomy for newsletter issues • template-resources.php - Three tidy queries to show each of our resource types
  • 60. Resources Content Structure Recap • single.php - Keep a tidy loop with a simple conditional and get_template_part() • Create two content templates - content-document.php for both case studies and white papers - content-newsletters.php for... newsletters
  • 61. Applied Benefits Of Content-First Development • Conclude that three CPTs are needed • Find that users would benefit from a meta box and custom taxonomy • Know to create one unique template: - template-resources.php
  • 62. Applied Benefits Of Content-First Development • Know to prepare UI elements for two content parts: 1.content-document.php 2.content-newsletters.php • Can note template files as wireframe notes for designers • Know that your end user will be able to find, edit, and create new content easily!
  • 64. A content-first development approach to WordPress makes for:
  • 65. A content-first development approach to WordPress makes for: • cleaner themes
  • 66. A content-first development approach to WordPress makes for: • cleaner themes • less back-tracking and exclamations of "oh yeah, we need to do this!"
  • 67. A content-first development approach to WordPress makes for: • cleaner themes • less back-tracking and exclamations of "oh yeah, we need to do this!" • happier end users
  • 68. A content-first development approach to WordPress makes for: • cleaner themes • less back-tracking and exclamations of "oh yeah, we need to do this!" • happier end users •happier you
  • 69. Q&A Time! Stephanie Eckles @5t3ph thinkdobecreate.com
  • 70. Q&A Time! Stephanie Eckles @5t3ph thinkdobecreate.com

Editor's Notes

  • #3: First, let&amp;apos;s look at why many of us build on WordPress.
  • #4: How many of you have heard some version of this question?It&amp;apos;s this question that led me to this topic, to help spread the word that WordPress is so much more than a blogging platform.
  • #5: First, let&amp;apos;s look at why many of us build on WordPress.
  • #6: I would go so far as to say… You may think you know WordPress, but I would bet some of you are actually stuck in a rut of doing things a certain way because it seems to work. That&amp;apos;s fine, but are you sure your way makes sense to the final content creator? Examining your process from a content-first perspective leads to cleaner themes and happier users.
  • #7: A thorough understanding of how WordPress retrieves and relates content leads to:
  • #8: But wait… how do you get started developing in a content-driven way?This may depend on if you&amp;apos;re a single-person shop or within an agency of some sort. Personally, I&amp;apos;m in the marketing department of a large corporation, but I also develop custom WordPress builds for freelance clients. No matter your situation, a content-first approach begins with asking:
  • #10: In this example, the first three are native behaviors, but the dynamically-related sidebar content needs more consideration.
  • #11: --- Learning to consider content relationships may lead you to think of even a &amp;quot;simple&amp;quot; marketing site in a more app-like way.Another way to consider relationships is by asking:
  • #13: Let&amp;apos;s look at developing the dynamic sidebar for our blog post example. So - this means that choosing the category for a post should be very purposeful, possibly even limited to a few strategic options.Or - maybe categories are actually types of portfolio work, so the related widget will pull in other logo posts.Or - maybe categories are used to identify courses for a recipe focused website, so the widget will show related main dishes.
  • #14: Categories can be used in those previous examples IF the site is very focused on those types of subjects. But let&amp;apos;s look at a larger example.
  • #15: ... and each of those comes with it&amp;apos;s own set of questions to narrow down the type of content to be entered for each. To figure out how to handle each of these, we need to find out...
  • #16: To determine our content creation structure, it&amp;apos;s helpful to learn how WordPress displays and relates different content.
  • #17: --- Here&amp;apos;s where content-first approach takes hold. Even seasoned developers have trouble with or completely miss the concept of how to define home page content. It took me a few years to stumble upon the correct information. The confusion stems from...
  • #19: I think this refresher may help more than the n00bs in the crowd. Public confession: I&amp;apos;ve only done this setup correctly for sites I&amp;apos;ve built in the past 6 months.
  • #23: Now that we&amp;apos;ve looked at how WordPress uses index, home, and front page templates, you can see why we&amp;apos;ve started there with our content-first development. --click-- It&amp;apos;s important to consider the site&amp;apos;s purpose before you even go so far as to create the structure for the front page. Here&amp;apos;s a few common scenarios that dictate the front page:
  • #27: ...I mention this because it&amp;apos;s how I did it until I took the time to finally get these three templates straightened out in my head! If you&amp;apos;ve been doing it this way too, perhaps you might benefit from knowing that defining the posts page means the query is all ready for you, including the paged variable. Just write a normal loop and include posts navigation and everything will work smoothly!
  • #29: Let&amp;apos;s continue on and look at… Ok, this one is pretty basic. In fact, it&amp;apos;s probably the first thing you learned when you signed up for a WordPress.com account and upgraded from your Blogger account. But let&amp;apos;s review:
  • #32: An additional layer of data you can include by default on either posts or pages is custom meta. In terms of content-driven development, this allows you to expand on the content entry ability default posts and pages in a comfortable but very useful way.
  • #35: If the site you&amp;apos;re building needs a blog, an About page, and a Contact page, sticking with just Posts and Pages is all you need to worry about.But if you&amp;apos;ve spent time developing custom solutions, you know that Posts and Pages can be pretty limiting. For any advanced functionality, you may be creating numerous custom page templates, and likely struggling with relating content beyond a parent/child relationship for pages and categories or tags for posts.Custom meta data can get you part of the way if you choose to use that to alter a query. However, custom meta can also lure you to the dark side of customization: offering too many options that aren&amp;apos;t needed for every single entry. --CLICK--Custom Post Types, or CPTs, allow you to define a wholly unique type of content. Today we&amp;apos;ll look at CPTs more theoretically rather than discuss every option available in creating them. Custom Post Types, or CPTs, allow you to define a wholly unique type of content. Today we&amp;apos;ll look at CPTs more theoretically rather than discuss every option available in creating them.
  • #38: I am of the school of thought that any functionality that creates new content belongs in a plugin so that site owners don&amp;apos;t lose access should they switch themes. You could argue that CPTs belong in themes because you may need to create templates to accommodate them. We&amp;apos;re not going to spend time going over all the pros and cons today, but it&amp;apos;s something to consider as you create a site that best fits your client&amp;apos;s needs.
  • #39: Back to our earlier example, one of the requirements for our marketing site was a resources section with the following types of content:
  • #44: Now that we know what content elements we&amp;apos;d like for each view, it&amp;apos;s time to consider what UI elements we&amp;apos;ll need for the user to enter that content. Based on what we&amp;apos;ve mapped out, and what we now know about various content types in WordPress, we&amp;apos;ll need...
  • #45: We also know we&amp;apos;ll want to...
  • #46: Our newsletter resource type is in need of a way to link posts belonging to the same issue, such as &amp;quot;Spring 2014&amp;quot;. Custom taxonomies are how we can achieve this because of:
  • #47: Now that we know what both of these are, a quick rule of thumb for choosing one over the other:
  • #48: Ok, we&amp;apos;ve settled how we&amp;apos;re entering content, so now let&amp;apos;s look at creating the view for the theme. --CLICK-- When we reviewed pages, we saw that there were multiple options in the template hierarchy for pages, and we need to choose one to customize our resources page. ---- For our purposes, we&amp;apos;ll chose to create a custom template template-resources.php because the risk of the slug changing is greater than if the template was applied to multiple pages. If you have fewer content editors, and perhaps have already had an SEO review validating your slug choice, you may decide to go with the slug option.
  • #49: Thanks to our careful content-driven structure, we can create the three loops we need on this page with ease!Our wireframe included showing up to 10 case studies and white papers in their own section, plus a newsletter section with all entries from the latest issue.
  • #52: One semi-tricky thing about Custom Post Types is they will use single.php as a default template. For our single resource views, we want a little extra markup to display the download document button, plus include a special sidebar. --CLICK--I&amp;apos;d like to introduce a pattern used by the excellent starter theme _s. It keeps things simple by only having single.php but modifying the default loop as follows:
  • #53: See the power in that? Now we can simply customize the guts of each post based on it&amp;apos;s type.
  • #54: For our purposes, the case study and white paper pages content will be the same, so we&amp;apos;ll take this our single.php loop one step further:--- Then, we can include the document download button just on content-document.php, and include the name of the issue on content-newsletter.php.
  • #55: We can employ a similar conditional to alter which sidebar gets included back on the single.php template:
  • #61: --CLICK-- for each