SlideShare a Scribd company logo
So I’m working on this ball again.
It’s still running on an old Genesis child theme, and I’m tired of falling all over the div IDs.
Time to port to HTML5 and spruce up a few things.
Now, let’s take a look at something.
If you were here last year, you know this joke. But what’s the difference between that ball - and this basic widgeted home page?
1
2 3 4
Not one thing, from a widget standpoint. That was last year’s punchline.
If you want to get technical, yes - the Clinix page has a header, and Frontenac - the ball - doesn’t.
The other thing they have in common is the reason we’ve gathered here today:
Home pages almost always have the home body class defined right here.
Here’s our big damn ball … this from last year’s version of the live site.
Here’s a content page.
The pros page has the pros body class.
Here’s a widgeted front page …
Here’s a content page.
Now, how many times have you built a home page and NOT, almost without thinking, defined its styles like this: .home row, .home .entry-footer, home this,
home that.
You couldn’t do that if the home body class wasn’t already baked into your theme.
Which it is, in almost every theme. Or a reasonable facsimile. Here’s Agency Pro, a Genesis child theme with HTML5.
Ever wonder how Genesis themes and others pull off their color variations? Here’s Agency Pro again.
And whattya do when a client has two completely different audiences to attract? Like my friend Naz here. Day business: commercial real estate.
Other times, he’s Coach Naz on the tennis court. One site, two topics two audiences.
Two body classes.
What if the Pros’ area …
needs to look different …
… from the programs area? Now we have three body classes!
Now, we’re not limited to any certain words in that long-butt body-class rule. We can use any of ‘em.
Now, we’re not limited to any certain words in that long-butt body-class rule. We can use any of ‘em.
Now, we’re not limited to any certain words in that long-butt body-class rule. We can use any of ‘em. Or if we don’t like those, we can make our own.
Here's a category archive from a hypothetical food blog - say, soups and stews.
We all know what a category archive is? Good
Maybe we want the dessert archive to have different colors.
In Genesis this is easy! We just add the body class - dessert - to the bottom of the post in the admin.
Then write new rules that all start with .dessert ...
Here’s one that also works in Genesis but doesn’t need it
I grabbed it from Philip Newcomer, the @BackwoodsCoder, who looks to have some nifty-looking plugins. Now, his version checks for single posts, but I like
the idea of adding a body class to the archive or anything else that might be in that category. And, this adds all the categories to the appropriate body-class
tags. So no picking and choosing - just style ‘em ;like you find ‘em.
So that foreach function assigns the category slug here …
See - there it is - it adds the slug …
and here!
Here it is, in the markup! PS> the function picks up the slug, so if you want this thing short, you can make it short. No reason to have to type something that
looks like your kitten wrote it in the middle of the night.
Heh. Maybe writing a function once is way better than writing 'desserts' on fifteen posts!
So with one function and as much or as little CSS as you feel like, you can go from salty chicken soup …
to sugary, chocolatey cupcakes …
To a buttoned-up business persona …
… To a fun-loving tennis coach and so much more.
Moi
Mary Baum
@marybaum

More Related Content

Similar to Target anything wilth body classes!

Widget areas
Widget areasWidget areas
Widget areas
WordCamp
 
Programming methodology lecture11
Programming methodology lecture11Programming methodology lecture11
Programming methodology lecture11NYversity
 
Visual rhetoric, April 22, 2013
Visual rhetoric, April 22, 2013Visual rhetoric, April 22, 2013
Visual rhetoric, April 22, 2013
Miami University
 
Tensorflow go
Tensorflow goTensorflow go
Tensorflow go
Patrick Walker
 
Scalding at Etsy
Scalding at EtsyScalding at Etsy
Scalding at Etsy
Dan McKinley
 
Intro to Drupal Slides - DrupalCampSC 2014
Intro to Drupal Slides - DrupalCampSC 2014Intro to Drupal Slides - DrupalCampSC 2014
Intro to Drupal Slides - DrupalCampSC 2014
Sarah Shealy
 
SW Drupal Summit - Upgrading 6 to 7
SW Drupal Summit - Upgrading 6 to 7SW Drupal Summit - Upgrading 6 to 7
SW Drupal Summit - Upgrading 6 to 7Amye Scavarda
 
Keeping Eloquent Eloquent
Keeping Eloquent EloquentKeeping Eloquent Eloquent
Keeping Eloquent Eloquent
Colin DeCarlo
 
WRA 210 April 14th PowerPoint
WRA 210 April 14th PowerPointWRA 210 April 14th PowerPoint
WRA 210 April 14th PowerPointMiami University
 
A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty
A Beginner's Guide to Popping the Bonnet and Getting Your Hands DirtyA Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty
A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty
Kenneth Scott Huntley
 
Visual Rhetoric, Feb 11, 2013
Visual Rhetoric, Feb 11, 2013Visual Rhetoric, Feb 11, 2013
Visual Rhetoric, Feb 11, 2013
Miami University
 
Lesson 4 Adding Navigator and PagesAdding Links Transcript- .docx
Lesson 4 Adding Navigator and PagesAdding Links Transcript- .docxLesson 4 Adding Navigator and PagesAdding Links Transcript- .docx
Lesson 4 Adding Navigator and PagesAdding Links Transcript- .docx
SHIVA101531
 
Programming methodology lecture08
Programming methodology lecture08Programming methodology lecture08
Programming methodology lecture08NYversity
 
La build your own website september 5
La build your own website september 5La build your own website september 5
La build your own website september 5
Thinkful
 
D:\Documents And Settings\Jamel King\Desktop\Washrinserepeat1
D:\Documents And Settings\Jamel King\Desktop\Washrinserepeat1D:\Documents And Settings\Jamel King\Desktop\Washrinserepeat1
D:\Documents And Settings\Jamel King\Desktop\Washrinserepeat1guestc11121
 
The Ultimate Guide to Scrapebox - The Only Scrapebox Tutorial You Need
The Ultimate Guide to Scrapebox - The Only Scrapebox Tutorial You NeedThe Ultimate Guide to Scrapebox - The Only Scrapebox Tutorial You Need
The Ultimate Guide to Scrapebox - The Only Scrapebox Tutorial You Need
frankmo920
 
Wait what? How to Enhance your Responsive Process with Content Questions
Wait what? How to Enhance your Responsive Process with Content QuestionsWait what? How to Enhance your Responsive Process with Content Questions
Wait what? How to Enhance your Responsive Process with Content Questions
Eileen Webb
 
Monday Night, Feb 10th Visrhet
Monday Night, Feb 10th VisrhetMonday Night, Feb 10th Visrhet
Monday Night, Feb 10th VisrhetMiami University
 
On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)
Zoe Landon
 

Similar to Target anything wilth body classes! (20)

Widget areas
Widget areasWidget areas
Widget areas
 
Programming methodology lecture11
Programming methodology lecture11Programming methodology lecture11
Programming methodology lecture11
 
Visual rhetoric, April 22, 2013
Visual rhetoric, April 22, 2013Visual rhetoric, April 22, 2013
Visual rhetoric, April 22, 2013
 
Tensorflow go
Tensorflow goTensorflow go
Tensorflow go
 
Scalding at Etsy
Scalding at EtsyScalding at Etsy
Scalding at Etsy
 
Intro to Drupal Slides - DrupalCampSC 2014
Intro to Drupal Slides - DrupalCampSC 2014Intro to Drupal Slides - DrupalCampSC 2014
Intro to Drupal Slides - DrupalCampSC 2014
 
SW Drupal Summit - Upgrading 6 to 7
SW Drupal Summit - Upgrading 6 to 7SW Drupal Summit - Upgrading 6 to 7
SW Drupal Summit - Upgrading 6 to 7
 
Keeping Eloquent Eloquent
Keeping Eloquent EloquentKeeping Eloquent Eloquent
Keeping Eloquent Eloquent
 
WRA 210 April 14th PowerPoint
WRA 210 April 14th PowerPointWRA 210 April 14th PowerPoint
WRA 210 April 14th PowerPoint
 
A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty
A Beginner's Guide to Popping the Bonnet and Getting Your Hands DirtyA Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty
A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty
 
Visual Rhetoric, Feb 11, 2013
Visual Rhetoric, Feb 11, 2013Visual Rhetoric, Feb 11, 2013
Visual Rhetoric, Feb 11, 2013
 
Lesson 4 Adding Navigator and PagesAdding Links Transcript- .docx
Lesson 4 Adding Navigator and PagesAdding Links Transcript- .docxLesson 4 Adding Navigator and PagesAdding Links Transcript- .docx
Lesson 4 Adding Navigator and PagesAdding Links Transcript- .docx
 
Programming methodology lecture08
Programming methodology lecture08Programming methodology lecture08
Programming methodology lecture08
 
La build your own website september 5
La build your own website september 5La build your own website september 5
La build your own website september 5
 
7. recap and q&a
7. recap and q&a7. recap and q&a
7. recap and q&a
 
D:\Documents And Settings\Jamel King\Desktop\Washrinserepeat1
D:\Documents And Settings\Jamel King\Desktop\Washrinserepeat1D:\Documents And Settings\Jamel King\Desktop\Washrinserepeat1
D:\Documents And Settings\Jamel King\Desktop\Washrinserepeat1
 
The Ultimate Guide to Scrapebox - The Only Scrapebox Tutorial You Need
The Ultimate Guide to Scrapebox - The Only Scrapebox Tutorial You NeedThe Ultimate Guide to Scrapebox - The Only Scrapebox Tutorial You Need
The Ultimate Guide to Scrapebox - The Only Scrapebox Tutorial You Need
 
Wait what? How to Enhance your Responsive Process with Content Questions
Wait what? How to Enhance your Responsive Process with Content QuestionsWait what? How to Enhance your Responsive Process with Content Questions
Wait what? How to Enhance your Responsive Process with Content Questions
 
Monday Night, Feb 10th Visrhet
Monday Night, Feb 10th VisrhetMonday Night, Feb 10th Visrhet
Monday Night, Feb 10th Visrhet
 
On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)
 

More from WordCamp

Momma's CSS-Grid
Momma's CSS-GridMomma's CSS-Grid
Momma's CSS-Grid
WordCamp
 
Structure style-story
Structure style-storyStructure style-story
Structure style-story
WordCamp
 
New rules for responsive design
New rules for responsive designNew rules for responsive design
New rules for responsive design
WordCamp
 
Designing for conversion
Designing for conversionDesigning for conversion
Designing for conversion
WordCamp
 
Design in WordPress: Three files, unlimited layouts #wcstl
Design in WordPress: Three files, unlimited layouts #wcstlDesign in WordPress: Three files, unlimited layouts #wcstl
Design in WordPress: Three files, unlimited layouts #wcstl
WordCamp
 
Three files, unlimited layouts: The designer's guide to WordPress freedom. #w...
Three files, unlimited layouts: The designer's guide to WordPress freedom. #w...Three files, unlimited layouts: The designer's guide to WordPress freedom. #w...
Three files, unlimited layouts: The designer's guide to WordPress freedom. #w...
WordCamp
 

More from WordCamp (6)

Momma's CSS-Grid
Momma's CSS-GridMomma's CSS-Grid
Momma's CSS-Grid
 
Structure style-story
Structure style-storyStructure style-story
Structure style-story
 
New rules for responsive design
New rules for responsive designNew rules for responsive design
New rules for responsive design
 
Designing for conversion
Designing for conversionDesigning for conversion
Designing for conversion
 
Design in WordPress: Three files, unlimited layouts #wcstl
Design in WordPress: Three files, unlimited layouts #wcstlDesign in WordPress: Three files, unlimited layouts #wcstl
Design in WordPress: Three files, unlimited layouts #wcstl
 
Three files, unlimited layouts: The designer's guide to WordPress freedom. #w...
Three files, unlimited layouts: The designer's guide to WordPress freedom. #w...Three files, unlimited layouts: The designer's guide to WordPress freedom. #w...
Three files, unlimited layouts: The designer's guide to WordPress freedom. #w...
 

Recently uploaded

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 

Recently uploaded (20)

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 

Target anything wilth body classes!

  • 1. So I’m working on this ball again. It’s still running on an old Genesis child theme, and I’m tired of falling all over the div IDs. Time to port to HTML5 and spruce up a few things. Now, let’s take a look at something.
  • 2. If you were here last year, you know this joke. But what’s the difference between that ball - and this basic widgeted home page?
  • 3. 1 2 3 4 Not one thing, from a widget standpoint. That was last year’s punchline. If you want to get technical, yes - the Clinix page has a header, and Frontenac - the ball - doesn’t. The other thing they have in common is the reason we’ve gathered here today:
  • 4. Home pages almost always have the home body class defined right here.
  • 5. Here’s our big damn ball … this from last year’s version of the live site.
  • 7. The pros page has the pros body class.
  • 8. Here’s a widgeted front page …
  • 10. Now, how many times have you built a home page and NOT, almost without thinking, defined its styles like this: .home row, .home .entry-footer, home this, home that. You couldn’t do that if the home body class wasn’t already baked into your theme.
  • 11. Which it is, in almost every theme. Or a reasonable facsimile. Here’s Agency Pro, a Genesis child theme with HTML5.
  • 12. Ever wonder how Genesis themes and others pull off their color variations? Here’s Agency Pro again.
  • 13. And whattya do when a client has two completely different audiences to attract? Like my friend Naz here. Day business: commercial real estate.
  • 14. Other times, he’s Coach Naz on the tennis court. One site, two topics two audiences. Two body classes.
  • 15. What if the Pros’ area …
  • 16. needs to look different …
  • 17. … from the programs area? Now we have three body classes!
  • 18. Now, we’re not limited to any certain words in that long-butt body-class rule. We can use any of ‘em.
  • 19. Now, we’re not limited to any certain words in that long-butt body-class rule. We can use any of ‘em.
  • 20. Now, we’re not limited to any certain words in that long-butt body-class rule. We can use any of ‘em. Or if we don’t like those, we can make our own.
  • 21. Here's a category archive from a hypothetical food blog - say, soups and stews. We all know what a category archive is? Good
  • 22. Maybe we want the dessert archive to have different colors.
  • 23. In Genesis this is easy! We just add the body class - dessert - to the bottom of the post in the admin.
  • 24.
  • 25.
  • 26. Then write new rules that all start with .dessert ...
  • 27. Here’s one that also works in Genesis but doesn’t need it I grabbed it from Philip Newcomer, the @BackwoodsCoder, who looks to have some nifty-looking plugins. Now, his version checks for single posts, but I like the idea of adding a body class to the archive or anything else that might be in that category. And, this adds all the categories to the appropriate body-class tags. So no picking and choosing - just style ‘em ;like you find ‘em.
  • 28. So that foreach function assigns the category slug here …
  • 29. See - there it is - it adds the slug …
  • 31. Here it is, in the markup! PS> the function picks up the slug, so if you want this thing short, you can make it short. No reason to have to type something that looks like your kitten wrote it in the middle of the night. Heh. Maybe writing a function once is way better than writing 'desserts' on fifteen posts!
  • 32. So with one function and as much or as little CSS as you feel like, you can go from salty chicken soup …
  • 33. to sugary, chocolatey cupcakes …
  • 34. To a buttoned-up business persona …
  • 35. … To a fun-loving tennis coach and so much more.