SlideShare a Scribd company logo
The Anatomy of
a WordPress CSS File
WordCamp 2014
April 14 – 15, 2014
Atlanta, Georgia
What We Will Discuss
• Cascading Style Sheets
• Theme Styling Options
• Primary Edit Files
• Identifying Edit Requirements
• Inspecting the Element
• Locating Edit Files
• Editing the Code
• Viewing the Results
2
CSS Styling Options
• Theme Options
• Built In Custom Fields (ex: Widgets)
• Editor Files
3
Theme Styling Options
4
Theme Styling Options Example
5
Widget Styling Options
6
Footer Text Color Edit – Before and After
7
Primary WordPress Style Sheets
• Three primary WordPress Style Sheets
– style.css
– header.php
– footer.php
8
Accessing WordPress Style Sheets
• Follow this path
– Dashboard > Appearance > Editor
• Back Up Prior to Editing
9
Locating Primary Style Sheets
10
header.php
11
footer.php
12
Types of Styles
• Tag Style – Create style rules that change HTML code
automatically; applies rule every time element
appears
– h1 { color: #efefef }
• Class Style – You name it; you manually select it
– i.e. a div
– .infoform{ color: #0076bf }
• ID Style – You can only apply once; use for single
unique elements
– #box { color: #ffffff}
13
Things You Should Know
• Basic Code Structure
– selector { attribute: value }
– h1 {color: #0076bf }
• !important Declarations
– !important declarations carry more weight
– !important declarations by author carry more weight
then !important declarations by the user
– Override with caution
– Could affect responsive designs (ex: size of elements)
14
What Is Contained in the CSS File
• Comment block from the author
• A set of style rules for the major elements of the
theme:
– h tags
– Colors and fonts
– Margins and padding
– Basic layout of primary elements
• (header, body, sidebars, footers)
• Basic design and layout rules for the theme
15
Inspecting the Element
This Example Uses Google Chrome
Using Chrome browser; right mouse click; select Inspect element
16
Element Identified
17
Locate CSS Code
Chrome Console shows file name and code line number
18
Practice with Twenty Eleven Theme
Change Background Color – Inspect the Element
19
Practice with Twenty Eleven Theme
Change Background Color – Identify Source Line
20
Practice with Twenty Eleven Theme
Change Background Color – Locate Code
Note: Installed WordPress Advanced Code Editor Plugin.
WordPress code does not have line numbers.
21
Practice with Twenty Eleven Theme
Change Background Color – Enter Color Hex
22
Practice with Twenty Eleven Theme
Change Background Color – Update File
23
Practice with Twenty Eleven Theme
Change Background Color – View Change
24
Practice with Twenty Eleven Theme
Reduce Site Title Size – Inspect the Element
25
Practice with Twenty Eleven Theme
Reduce Site Title Size – Edit Code
26
Practice with Twenty Eleven Theme
Reduce Site Title Size – Reduce Size
27
Practice with Twenty Eleven Theme
Reduce Site Title Size – View Change
28
Some of the Elements You Can Edit
There Are So Many Possibilities
29
Before and After Example
30
The Anatomy of the CSS File
• Decide what you want to edit
• Inspect the element in browser
• Find the code in the CSS file
• Customize the code
• Enjoy the enhancements
31
Thank You
32

More Related Content

PPTX
Lecture3 web design and development
PPTX
Web Development - Lecture 5
PPTX
Web Development - Lecture 6
ODP
Design Best Practices for WordPress
PPTX
Web 102 INtro to CSS
PPTX
How to get your theme in WordPress
PPT
9781111528705_PPT_ch04.ppt
PDF
Newbies guide to customizing word press themes 25
Lecture3 web design and development
Web Development - Lecture 5
Web Development - Lecture 6
Design Best Practices for WordPress
Web 102 INtro to CSS
How to get your theme in WordPress
9781111528705_PPT_ch04.ppt
Newbies guide to customizing word press themes 25

Similar to The Anatomy of a WordPress File (20)

PPTX
Design todevelop
PPTX
MCC Web Design Workshop
PPTX
Starting WordPress Theme Review
PPTX
Cascading style sheet an introduction
PPT
Ppt ch04
PPT
Ppt ch04
PPTX
Wordpress theme development
PPTX
Unit d adobe dreamweaver cs6
PPTX
Blackboard DevCon 2011 - Performance Considerations for Custom Theme Development
PDF
Code & design your first website (3:16)
PDF
Code & Design your first website 4/18
PPTX
Atlanta Drupal User Group (ADUG)
PDF
WordPress Theme Workshop: Part 2
PPTX
basic programming language AND HTML CSS JAVApdf
PPTX
WordPress Themes and Plugins
PPTX
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
PDF
Anatomy of a Wordpress theme
PPTX
Ifi7174 lesson2
PPT
ch04-css-basics_final.ppt
PPTX
Html,CSS & UI/UX design
Design todevelop
MCC Web Design Workshop
Starting WordPress Theme Review
Cascading style sheet an introduction
Ppt ch04
Ppt ch04
Wordpress theme development
Unit d adobe dreamweaver cs6
Blackboard DevCon 2011 - Performance Considerations for Custom Theme Development
Code & design your first website (3:16)
Code & Design your first website 4/18
Atlanta Drupal User Group (ADUG)
WordPress Theme Workshop: Part 2
basic programming language AND HTML CSS JAVApdf
WordPress Themes and Plugins
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
Anatomy of a Wordpress theme
Ifi7174 lesson2
ch04-css-basics_final.ppt
Html,CSS & UI/UX design
Ad

Recently uploaded (20)

DOCX
A Contemporary Luxury Villa in Dubai Jumeirah-2.docx
PDF
BRANDBOOK-Presidential Award Scheme-Kenya-2023
PDF
Test slideshare presentation for blog post
PPTX
HPE Aruba-master-icon-library_052722.pptx
PDF
ART & DESIGN HISTORY OF VEDIC CIVILISATION.pdf
PPTX
Media And Information Literacy for Grade 12
PDF
Phone away, tabs closed: No multitasking
PDF
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
PPTX
Complete Guide to Microsoft PowerPoint 2019 – Features, Tools, and Tips"
PPTX
Special finishes, classification and types, explanation
PPTX
EDP Competencies-types, process, explanation
PPTX
CLASSIFICATION OF YARN- process, explanation
PPT
WHY_R12 Uaafafafpgradeaffafafafaffff.ppt
PPT
Machine printing techniques and plangi dyeing
PDF
Urban Design Final Project-Site Analysis
PDF
Introduction-to-World-Schools-format-guide.pdf
PPTX
LITERATURE CASE STUDY DESIGN SEMESTER 5.pptx
PPT
UNIT I- Yarn, types, explanation, process
PDF
intro_to_rust.pptx_123456789012446789.pdf
PDF
Urban Design Final Project-Context
A Contemporary Luxury Villa in Dubai Jumeirah-2.docx
BRANDBOOK-Presidential Award Scheme-Kenya-2023
Test slideshare presentation for blog post
HPE Aruba-master-icon-library_052722.pptx
ART & DESIGN HISTORY OF VEDIC CIVILISATION.pdf
Media And Information Literacy for Grade 12
Phone away, tabs closed: No multitasking
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
Complete Guide to Microsoft PowerPoint 2019 – Features, Tools, and Tips"
Special finishes, classification and types, explanation
EDP Competencies-types, process, explanation
CLASSIFICATION OF YARN- process, explanation
WHY_R12 Uaafafafpgradeaffafafafaffff.ppt
Machine printing techniques and plangi dyeing
Urban Design Final Project-Site Analysis
Introduction-to-World-Schools-format-guide.pdf
LITERATURE CASE STUDY DESIGN SEMESTER 5.pptx
UNIT I- Yarn, types, explanation, process
intro_to_rust.pptx_123456789012446789.pdf
Urban Design Final Project-Context
Ad

The Anatomy of a WordPress File

  • 1. The Anatomy of a WordPress CSS File WordCamp 2014 April 14 – 15, 2014 Atlanta, Georgia
  • 2. What We Will Discuss • Cascading Style Sheets • Theme Styling Options • Primary Edit Files • Identifying Edit Requirements • Inspecting the Element • Locating Edit Files • Editing the Code • Viewing the Results 2
  • 3. CSS Styling Options • Theme Options • Built In Custom Fields (ex: Widgets) • Editor Files 3
  • 7. Footer Text Color Edit – Before and After 7
  • 8. Primary WordPress Style Sheets • Three primary WordPress Style Sheets – style.css – header.php – footer.php 8
  • 9. Accessing WordPress Style Sheets • Follow this path – Dashboard > Appearance > Editor • Back Up Prior to Editing 9
  • 13. Types of Styles • Tag Style – Create style rules that change HTML code automatically; applies rule every time element appears – h1 { color: #efefef } • Class Style – You name it; you manually select it – i.e. a div – .infoform{ color: #0076bf } • ID Style – You can only apply once; use for single unique elements – #box { color: #ffffff} 13
  • 14. Things You Should Know • Basic Code Structure – selector { attribute: value } – h1 {color: #0076bf } • !important Declarations – !important declarations carry more weight – !important declarations by author carry more weight then !important declarations by the user – Override with caution – Could affect responsive designs (ex: size of elements) 14
  • 15. What Is Contained in the CSS File • Comment block from the author • A set of style rules for the major elements of the theme: – h tags – Colors and fonts – Margins and padding – Basic layout of primary elements • (header, body, sidebars, footers) • Basic design and layout rules for the theme 15
  • 16. Inspecting the Element This Example Uses Google Chrome Using Chrome browser; right mouse click; select Inspect element 16
  • 18. Locate CSS Code Chrome Console shows file name and code line number 18
  • 19. Practice with Twenty Eleven Theme Change Background Color – Inspect the Element 19
  • 20. Practice with Twenty Eleven Theme Change Background Color – Identify Source Line 20
  • 21. Practice with Twenty Eleven Theme Change Background Color – Locate Code Note: Installed WordPress Advanced Code Editor Plugin. WordPress code does not have line numbers. 21
  • 22. Practice with Twenty Eleven Theme Change Background Color – Enter Color Hex 22
  • 23. Practice with Twenty Eleven Theme Change Background Color – Update File 23
  • 24. Practice with Twenty Eleven Theme Change Background Color – View Change 24
  • 25. Practice with Twenty Eleven Theme Reduce Site Title Size – Inspect the Element 25
  • 26. Practice with Twenty Eleven Theme Reduce Site Title Size – Edit Code 26
  • 27. Practice with Twenty Eleven Theme Reduce Site Title Size – Reduce Size 27
  • 28. Practice with Twenty Eleven Theme Reduce Site Title Size – View Change 28
  • 29. Some of the Elements You Can Edit There Are So Many Possibilities 29
  • 30. Before and After Example 30
  • 31. The Anatomy of the CSS File • Decide what you want to edit • Inspect the element in browser • Find the code in the CSS file • Customize the code • Enjoy the enhancements 31