際際滷

際際滷Share a Scribd company logo
So Im working on this ball again.
Its still running on an old Genesis child theme, and Im tired of falling all over the div IDs.
Time to port to HTML5 and spruce up a few things.
Now, lets take a look at something.
If you were here last year, you know this joke. But whats 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 years punchline.
If you want to get technical, yes - the Clinix page has a header, and Frontenac - the ball - doesnt.
The other thing they have in common is the reason weve gathered here today:
Home pages almost always have the home body class defined right here.
Heres our big damn ball  this from last years version of the live site.
Heres a content page.
The pros page has the pros body class.
Heres a widgeted front page
Heres 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 couldnt do that if the home body class wasnt already baked into your theme.
Which it is, in almost every theme. Or a reasonable facsimile. Heres Agency Pro, a Genesis child theme with HTML5.
Ever wonder how Genesis themes and others pull off their color variations? Heres 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, hes 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, were not limited to any certain words in that long-butt body-class rule. We can use any of em.
Now, were not limited to any certain words in that long-butt body-class rule. We can use any of em.
Now, were not limited to any certain words in that long-butt body-class rule. We can use any of em. Or if we dont 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.
Target anything wilth body classes!
Target anything wilth body classes!
Then write new rules that all start with .dessert ...
Heres one that also works in Genesis but doesnt 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! (20)

PDF
Build Your Own Website A Comic Guide to HTML, CSS and Wordpress (Nate Cooper)...
Oliver Palma
DOCX
ARTICULOENINGLES
M坦nica S叩nchez Crisostomo
PPTX
css3.pptx
ThiyaguPappu
PDF
From a Fireworks Comp to a Genesis Child Theme, Step by Step
East Bay WordPress Meetup
PDF
Intro to CSS Presentation
WP Pittsburgh Meetup Group
PDF
OOCSS Lightening Talk
Julie Cameron
PPTX
Customizing WordPress Themes
Domestic Equity Studio
PDF
Design for developers (april 25, 2017)
Thinkful
PPTX
Web designing course bangalore
Infocampus Logics Pvt.Ltd.
KEY
Sass Essentials at Mobile Camp LA
Jake Johnson
PPTX
Scalable and Modular CSS FTW!
FITC
PPTX
uptu web technology unit 2 Css
Abhishek Kesharwani
DOC
Class 2 handout css exercises (2)
Erin M. Kidwell
PDF
WordPress for Designers
Red8 Interactive
PDF
More of less (take 2)
Guilherme Z端hlke O'Connor
PDF
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Erin M. Kidwell
PDF
Create a landing page
Fabien Vauchelles
PPTX
Rock Solid CSS Architecture
John Need
PDF
Design and CSS
nolly00
PPTX
web Technolotogies notes lke CSS443.pptx
ssuser46d915
Build Your Own Website A Comic Guide to HTML, CSS and Wordpress (Nate Cooper)...
Oliver Palma
css3.pptx
ThiyaguPappu
From a Fireworks Comp to a Genesis Child Theme, Step by Step
East Bay WordPress Meetup
Intro to CSS Presentation
WP Pittsburgh Meetup Group
OOCSS Lightening Talk
Julie Cameron
Customizing WordPress Themes
Domestic Equity Studio
Design for developers (april 25, 2017)
Thinkful
Web designing course bangalore
Infocampus Logics Pvt.Ltd.
Sass Essentials at Mobile Camp LA
Jake Johnson
Scalable and Modular CSS FTW!
FITC
uptu web technology unit 2 Css
Abhishek Kesharwani
Class 2 handout css exercises (2)
Erin M. Kidwell
WordPress for Designers
Red8 Interactive
More of less (take 2)
Guilherme Z端hlke O'Connor
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Erin M. Kidwell
Create a landing page
Fabien Vauchelles
Rock Solid CSS Architecture
John Need
Design and CSS
nolly00
web Technolotogies notes lke CSS443.pptx
ssuser46d915

More from WordCamp (7)

PDF
Momma's CSS-Grid
WordCamp
PDF
Widget areas
WordCamp
PDF
Structure style-story
WordCamp
PDF
New rules for responsive design
WordCamp
PDF
Designing for conversion
WordCamp
PDF
Design in WordPress: Three files, unlimited layouts #wcstl
WordCamp
PDF
Three files, unlimited layouts: The designer's guide to WordPress freedom. #w...
WordCamp
Momma's CSS-Grid
WordCamp
Widget areas
WordCamp
Structure style-story
WordCamp
New rules for responsive design
WordCamp
Designing for conversion
WordCamp
Design in WordPress: Three files, unlimited layouts #wcstl
WordCamp
Three files, unlimited layouts: The designer's guide to WordPress freedom. #w...
WordCamp
Ad

Recently uploaded (20)

PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
PPTX
Simplifica la seguridad en la nube y la detecci坦n de amenazas con FortiCNAPP
Cristian Garcia G.
PPTX
Practical Applications of AI in Local Government
OnBoard
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
PDF
Kubernetes - Architecture & Components.pdf
geethak285
PPTX
Enabling the Digital Artisan keynote at ICOCI 2025
Alan Dix
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
PPTX
叶Wondershare Filmora Crack 14.0.7 + Key Download 2025
sebastian aliya
PDF
Unlocking FME Flows Potential: Architecture Design for Modern Enterprises
Safe Software
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
PDF
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
Simplifica la seguridad en la nube y la detecci坦n de amenazas con FortiCNAPP
Cristian Garcia G.
Practical Applications of AI in Local Government
OnBoard
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
Kubernetes - Architecture & Components.pdf
geethak285
Enabling the Digital Artisan keynote at ICOCI 2025
Alan Dix
Why aren't you using FME Flow's CPU Time?
Safe Software
叶Wondershare Filmora Crack 14.0.7 + Key Download 2025
sebastian aliya
Unlocking FME Flows Potential: Architecture Design for Modern Enterprises
Safe Software
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
Ad

Target anything wilth body classes!

  • 1. So Im working on this ball again. Its still running on an old Genesis child theme, and Im tired of falling all over the div IDs. Time to port to HTML5 and spruce up a few things. Now, lets take a look at something.
  • 2. If you were here last year, you know this joke. But whats 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 years punchline. If you want to get technical, yes - the Clinix page has a header, and Frontenac - the ball - doesnt. The other thing they have in common is the reason weve gathered here today:
  • 4. Home pages almost always have the home body class defined right here.
  • 5. Heres our big damn ball this from last years version of the live site.
  • 7. The pros page has the pros body class.
  • 8. Heres 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 couldnt do that if the home body class wasnt already baked into your theme.
  • 11. Which it is, in almost every theme. Or a reasonable facsimile. Heres Agency Pro, a Genesis child theme with HTML5.
  • 12. Ever wonder how Genesis themes and others pull off their color variations? Heres 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, hes 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, were not limited to any certain words in that long-butt body-class rule. We can use any of em.
  • 19. Now, were not limited to any certain words in that long-butt body-class rule. We can use any of em.
  • 20. Now, were not limited to any certain words in that long-butt body-class rule. We can use any of em. Or if we dont 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.
  • 26. Then write new rules that all start with .dessert ...
  • 27. Heres one that also works in Genesis but doesnt 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
  • 34. To a buttoned-up business persona
  • 35. To a fun-loving tennis coach and so much more.