SlideShare a Scribd company logo
Intro to WordPress Theming
Andy McIlwain (www.andymci.com)
Techalicious +TorontoWordPress Group
Crafting Custom CSS | @andymci | #PCTO152015-04-06 1
Hi! I’m Andy McIlwain.
Developer at:
Brainrider
Marketers Without Borders
Events&
Instructor/Mentor at:
Camp Tech
Ladies Learning Code
Organizer with:
Toronto WordPress Meetups
WordCamp Toronto
Find me online:
@andymci on Twitter
linkedin.com/in/andymci
instagram.com/andy.mcilwa
in
Crafting Custom CSS | @andymci | #PCTO152015-04-06 2
Prerequisites.
Let’s get some fundamentals out of the way first.
April 4, 2015 WordPress Theming | @andymci | #WPTO 3
How do websites work?
1. User asks for site.
You punch a URL into your
browser’s address bar.
3. Code sent to the browser.
The server does its thing
sends the website code back
the user’s browser.
2. Computer looks for the
site.
It connects to the server
through the magic of the
internet.
4. Browser displays the site.
User’s browser puts the
returned code (HTML, CSS,
and JavaScript) together to
display the website.Crafting Custom CSS | @andymci | #PCTO152015-04-06 4
Here’s a visualization…
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 5
User ServerBrowser
Enters Website URL Connects to Server
Returns Website CodeDisplays Website
So what’s loading in
the browser, anyway?
Let’s take a closer look…
April 4, 2015 WordPress Theming | @andymci | #WPTO 6
The Structure of a Website
Server: Generates site code.
HTML: The webpage
structure and content.
CSS: Rules that control the
“look and feel” of the
JavaScript: Adds interaction,
effects, and additional
functionality.
Server
HTML
CSS JavaScript
2015-04-06 7
It’s like building a house!
Server
HTML
CSS JavaScript
Foundation
Framing, Flooring,
Drywall
Fixtures,
Carpeting, Paint
Electrical,
Plumbing, HVAC
Crafting Custom CSS | @andymci | #PCTO152015-04-06 8
We choose what to build on.
Server
HTML
CSS JavaScript
Foundation
Framing, Flooring,
Drywall
Fixtures,
Carpeting, Paint
Electrical,
Plumbing, HVAC
Crafting Custom CSS | @andymci | #PCTO152015-04-06 9
Then we set up the structure.
Server
HTML
CSS JavaScript
Foundation
Framing, Flooring,
Drywall
Fixtures,
Carpeting, Paint
Electrical,
Plumbing, HVAC
Crafting Custom CSS | @andymci | #PCTO152015-04-06 10
Set up controls and interaction.
Server
HTML
CSS JavaScript
Foundation
Framing, Flooring,
Drywall
Fixtures,
Carpeting, Paint
Electrical,
Plumbing, HVAC
Crafting Custom CSS | @andymci | #PCTO152015-04-06 11
Then we make everything pretty.
Server
HTML
CSS JavaScript
Foundation
Framing, Flooring,
Drywall
Fixtures,
Carpeting, Paint
Electrical,
Plumbing, HVAC
Crafting Custom CSS | @andymci | #PCTO152015-04-06 12
What about
WordPress?
April 4, 2015 WordPress Theming | @andymci | #WPTO 13
How does WordPress work?
1. Server-side software.
You install WordPress on the
server where the site will
3. Method to manage
content.
WordPress back-end (wp-
is where we can safely
content in the database.
2. Generates webpages.
WordPress pulls content
from a database, adds
HTML/CSS/JS.
4. Extend with themes,
plugins.
Themes control look, feel,
and functionality. Plugins
control functionality.
Crafting Custom CSS | @andymci | #PCTO152015-04-06 14
WordPress on your Server
Database: Where content
and site options are stored.
WordPress: Core software,
connects to the database.
Theme: Controls the
appearance of your website.
one theme can be active at a
time.
Plugins: Adds additional
functionality to your site.
Database
WordPress
Theme Plugins
Crafting Custom CSS | @andymci | #PCTO152015-04-06 15
Here’s a visualization…
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 16
User ServerBrowser
Enters Website URL Connects to Server
Returns Site CodeDisplays Website Runs WordPress
How do we install WordPress?
One-Click Install.
The fastest method.
most shared hosting
Managed hosts.
Managed WordPress hosts,
WP Engine or Flywheel, have
WordPress pre-installed.
Manual installation.
Technical, best suited for
more advanced users.
(Creating DB, uploading
WordPress files via FTP,
editing wp-config.php.)
Crafting Custom CSS | @andymci | #PCTO152015-04-06 17
WordPress Lingo 101
Posts
Can be categorized and
Associated with a date, time,
author. Suitable for articles,
posts, blogs.
Categories & Tags
(Taxonomies)
Categories have a hierarchy.
do not.
Pages
Can have a hierarchy. Can
be assigned templates (if
supported by a theme).
Suitable for content that
changes infrequently.
Page Templates
Unique to a theme.
Designates different page
layouts or functionality.
Crafting Custom CSS | @andymci | #PCTO152015-04-06 18
More Lingo!
Permalinks
Unique URL for every piece
content on your site (posts,
pages, archives, etc…)
Themes
Handle the appearance of
site, plus some functionality.
Plugins
Extend the functionality of a
site. Can be simple (contact
forms) or complex (e-
commerce).
The Codex
The go-to resource. Find it
@
codex.wordpress.org
Crafting Custom CSS | @andymci | #PCTO152015-04-06 19
Let’s Talk Themes
The best things in life are (often) free.
April 4, 2015 WordPress Theming | @andymci | #WPTO 20
wordpress.org/themes/
• Browse and search for themes
that meet specific criteria.
• Read reviews, see what people
are saying about the themes.
• Check for a direct “Theme
Homepage” link.Theme author
sites usually have better
previews, documentation.
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 21
What makes for a good theme?
Clean Layout
Easier to add your own flare
images and custom CSS.
Available Reviews, Examples
See how the theme is being
“in the wild”. Look for
from existing users.
Well Documented
Includes inline
documentation (comments
in code).
Crafting Custom CSS | @andymci | #PCTO152015-04-06 22
My favourite theme: Make
• Drag-and-drop builder for
quickly building complex page
layouts without code.
• Can target unique IDs and
classes to add custom CSS.
• Opportunities for advanced
development with hooks and
filters.
• Pro version offers even more!
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 23
https://wordpress.org/themes/make/
Customizing Themes
with CSS
Dipping our toes into the waters of theme development.
April 4, 2015 WordPress Theming | @andymci | #WPTO 24
Remember this stack?
Server
HTML
CSS JavaScript
Crafting Custom CSS | @andymci | #PCTO152015-04-06 25
Controlled by the theme.
Database
WordPress
Theme Plugins
Let’s drill into the CSS.
Server
HTML
CSS JavaScript
Crafting Custom CSS | @andymci | #PCTO152015-04-06 26
CSS
CSS stands for Cascading Style
Sheets.They control the “look and
and feel” of web pages. If we were
building a house, CSS would be in
charge of laying the carpet and
painting the walls.
Key points to remember:
• CSS sets appearance rules for
HTML
• Targets elements, classes, and IDs
• Rules wrapped in “curly brackets”
{ like this }
body {
background: white;
font-family: Arial, sans-
serif;
}
#head {
background: black;
color: white;
}
#content p {
font-size: 14px;
margin: 10px 0;
}
Crafting Custom CSS | @andymci | #PCTO152015-04-06 27
How HTML & CSS Work Together
When your browser loads a page, it looks at
the elements on the page and checks if there
are CSS rules for those elements. Key points:
• HTML uses id and class
• CSS uses # and .
• When we see id, we target with #
• When we see class, we target with .
HTML CSS
<div id=“header”>
</div>
#header {}
<div class=“post”>
</div>
.post {}
Crafting Custom CSS | @andymci | #PCTO152015-04-06 28
Connecting HTML & CSS
HTML CSS
<body>
<div id=“header”>
</div>
<div id=“content”>
<div class=“post”>
</div>
</div>
<div id=“footer”>
</div>
</body>
body {}
#header {}
#content {}
.post {}
#footer {}
Crafting Custom CSS | @andymci | #PCTO152015-04-06 29
Getting More Specific
HTML CSS
<div class=“post”>
<h2>Post Title</h2>
<p>Paragraph of content.</p>
</div>
.post {}
<div class=“post”>
<h2>Post Title</h2>
<p>Paragraph of content.</p>
</div>
.post h2 {}
<div class=“post”>
<h2>Post Title</h2>
<p>Paragraph of content.</p>
</div>
.post p {}
Crafting Custom CSS | @andymci | #PCTO152015-04-06 30
What Rules Can We Use?
Some Example Rules What It Does
background-image: url(…) Defines background image.
float: left; Positioning relative to subsequent elements.
background-color: #fff; Defines background color.
font-family: Arial, sans-serif; Defines the font to use.
font-size: 24px; Defines the size of the font.
font-weight: bold; Defines the weight of the font.
color: red; Defines the colour of the font.
width: 400px; Defines the width of the targeted element.
height: 400px; Defines the height of the targeted element.
Find more rules at tympanus.net/codrops/css_reference/
Crafting Custom CSS | @andymci | #PCTO152015-04-06 31
Inspecting Other’s Work
• Your browser comes
equipped with
DeveloperTools
• You can inspect page
code
• You can play with code
that only affects your
browser
Here’s how you do it in Firefox, Chrome, Internet Explorer, and Safari.
Crafting Custom CSS | @andymci | #PCTO152015-04-06 32
How can we apply custom CSS?
Plugins
Jetpack’s Custom CSS
Simple Custom CSS
Theme Options
Some themes include
support for applying custom
CSS.
Crafting Custom CSS | @andymci | #PCTO152015-04-06 33
Baby Steps to Theme Building:
1. Inspect your theme.
2. Find IDs and classes.
3. Apply custom CSS.
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 34
Starter Themes
vs. Theme Frameworks
(Kicking customization up a notch.)
April 4, 2015 WordPress Theming | @andymci | #WPTO 35
What’s the difference?
Starter Themes
• Download the code and
modify it to create a new
theme from scratch.
• Future updates to the
starter theme will not
affect older themes you
created with the starter
theme.
Theme Frameworks
• A parent theme that you do
not edit directly. Your
theme will be a child of the
framework theme.
• Future updates to the
framework (parent theme)
are inherited by your
theme (the child theme).
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 36
e.g. Underscores vs. Genesis
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 37
http://underscores.me/ http://my.studiopress.com/themes/genesis/
Starter Theme
Framework
What’s a child theme?
Child themes build on top of other themes.
They inherit and override code from the
parent theme.
From the Codex:
• If you modify a theme directly and it is
updated, then your modifications may be
lost. By using a child theme you will
ensure that your modifications are
preserved.
• Using a child theme can speed up
development time.
• Using a child theme is a great way to to
learn aboutWordPress theme
development.
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 38
FYI: Genesis themes are all child
themes of the Genesis theme
framework.
Next Steps to Theme Building:
- Choose starter theme or
framework.
- Modify starter theme, or
- Create framework child theme.
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 39
Building Your Own
Theme From Scratch
(It’s not as hard as it sounds!)
April 4, 2015 WordPress Theming | @andymci | #WPTO 40
Wireframing: Paper to Pixels
1. Block it out.
Start with a simple layout of
blocks.
3. Add details & variations.
Once you’ve locked in on an
approach, start modifying
different purposes.
2. Give each block a job.
Header, footer, sidebar,
post. Start simple, gradually
build up.
4. Make it digital.
Use an app to share, collect
feedback, make
modifications.
2015-04-06 41
For example…
We start by blocking it out.
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 42
Then we give
each block a job.
The basics: Header, Content, Footer.
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 43
Header
Footer
Content
Then we modify.
Here’s a home page.
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 44
Logo
Footer
Welcome
Message
Intro Video
Upcoming Events
Navigation
Then we modify.
Here’s a list of events.
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 45
Logo
Footer
Event
Navigation
Event
Event
Promos
Then we modify.
Here’s a single event.
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 46
Logo
Footer
Event
Navigation
Promos
Note the blocks that don’t change.
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 47
Logo
Footer
Event
Navigation
Promos
Logo
Footer
Event
Navigation
Event
Event
Promos
Logo
Footer
Welcome
Message
Intro Video
Upcoming Events
Navigation
We’ll be coming back to these in a bit…!
Create an HTML & CSS Mockup
Turn layouts into HTML files.
You can do all of this on
computer, no PHP required.
Style everything in style.css
This is your chance to nail
much of the design as you
Add placeholders.
Use placeholders for
images, text, and additional
markup.
Link files together.
You can create a semblance
of “user flow” linking from
HTML file to HTML file. (e.g.
homepage to post,
homepage to page).2015-04-06 48
Need a primer on good design?
2015-04-06 49
http://learndesignprinciples.com
http://goodui.org
Oldie but a goodie:
http://www.smashingmagazine.com/2008/01/31/10-
principles-of-effective-web-design/
Get the following:
FTP app to move files.
I recommend Filezilla.
App for editing images.
Photoshop CC or GIMP
(free).
Editor app to work with
code.
I recommend Sublime Text.
A running WordPress site.
What good is a theme if you
don’t have a site to test it
on?
2015-04-06 50
How do we begin theming?
Start with the basics.
Minimum requirements:
index.php and style.css
Add template tags to
index.php
In WordPress, template tags
just PHP functions. Here’s a
listing of template tags.
Add theme info to style.css
This header information is
checked for theme details.
Install in WordPress!
Put your theme files in a
folder under /wp-
content/themes/.
2015-04-06 51
Tags You Should Know
<?php wp_head(); ?> / <?php wp_footer(); ?>
Sets “hooks” for WordPress core, plugins, and themes to inject
additional code into the header or footer of the site.
(Here’s some more info about hooks and filters in WordPress.)
<?php bloginfo(‘###’); ?>
Retrieves all sorts of information about your site. Link
e.g. Site title, theme directory, admin email.
2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 52
The WordPress Loop
“Loops” through the database, finds content, displays it according to
the tags you’ve defined in the loop.
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
// Post Content Here //
<?php endwhile; else : ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
2015-04-06 53
Let’s build a theme!
- Wireframes are our guide.
- We’ll build a prototype in HTML.
- Then transform it into a theme.
2015-04-06 54
(Cue live demo alt-tab!)
Next Steps
Where do we go from here…?
April 4, 2015 WordPress Theming | @andymci | #WPTO 55
Ideas for next steps:
Build your first theme.
Create a theme and submit
the WordPress Theme
Contribute to a theme.
The beauty of open source
you can make improvements
things other people have
Build a simple site for a
friend.
This is how many people get
started w/ professional
work.
Review others’ work.
Crack open what others
have built and learn from
their work.
2015-04-06 56
Theme Development Resources
ThemeShaperTutorial
Theme Development (Codex)
WordPressTemplateTags
WordPress Code Reference
WordPress Coding Standards
WordPressTheme Review Guide
WordPress Answers
VIP Best Practices
Developer Plugin
GenerateWP
WP Gear
Skeleton Boilerplate
XAMPP
Balsamiq
Crafting Custom CSS | @andymci | #PCTO152015-04-06 57
Useful CSS Tools & Resources
CSS Reference
MDN CSS Reference
CoDrops CSS Reference
Inspiration
CSS Tricks
CSS Zen Garden
CSS Mania
Courses
Codecademy CSS Course
CodeSchool CSS
Treehouse CSS Basics
Useful Tools
CodePen
Skeleton
Crafting Custom CSS | @andymci | #PCTO152015-04-06 58
Thank You! Questions?
Slides will be posted online:
www.slideshare.net/andymci
Find me online:
www.andymci.com | @andymci | linkedin.com/in/andymci
Crafting Custom CSS | @andymci | #PCTO152015-04-06 59

More Related Content

PDF
A Designers Approach to Customizing Themes
PDF
Wp 3hr-course
PPTX
Lesson 107 23 aug13-1430-ay
PPTX
MCC Web Design Workshop
PDF
WordPress, Domain Names and Web Hosting Basics
PDF
Html:css crash course (4:5)
PDF
Thinkful - Frontend Crash Course - Intro to HTML/CSS
PPTX
Build your WordPress page fast and clean
A Designers Approach to Customizing Themes
Wp 3hr-course
Lesson 107 23 aug13-1430-ay
MCC Web Design Workshop
WordPress, Domain Names and Web Hosting Basics
Html:css crash course (4:5)
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Build your WordPress page fast and clean

What's hot (20)

PPTX
Lesson 201 14 sep13-1500-ay
PDF
Html css crash course may 11th, atlanta
PPTX
WordPress Questions and Answers Session
PDF
WordPress Themes Demystified
PDF
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
PPTX
Designing for WordPress
PPTX
Web1O1 - Intro to HTML/CSS
PPT
Strayer cis-273-week-8-assignment-single-page-website-new
PDF
CSS For Backend Developers
PPTX
Web 101 intro to html
PPT
It’s a blog. it’s a website.
PDF
Organize Your Website With Advanced CSS Tricks
KEY
PPTX
Introduction to CSS
PDF
CSS Interview Questions for Fresher and Experience
PDF
WordPress: More-than-blog-software
PDF
Introduction to WordPress
PPT
Wordpress for Business
PPTX
Smash.wordpress
Lesson 201 14 sep13-1500-ay
Html css crash course may 11th, atlanta
WordPress Questions and Answers Session
WordPress Themes Demystified
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
Designing for WordPress
Web1O1 - Intro to HTML/CSS
Strayer cis-273-week-8-assignment-single-page-website-new
CSS For Backend Developers
Web 101 intro to html
It’s a blog. it’s a website.
Organize Your Website With Advanced CSS Tricks
Introduction to CSS
CSS Interview Questions for Fresher and Experience
WordPress: More-than-blog-software
Introduction to WordPress
Wordpress for Business
Smash.wordpress
Ad

Similar to Intro to WordPress Theming (20)

PPTX
Crafting Custom CSS @ PodCamp Toronto 2015 #PCTO15
PPTX
Word Press As A Cms
PDF
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
PDF
Cosmology of the web - Lecture 1
PPTX
HTML/CSS for WordPress
KEY
Beginners' Guide to WordPress
KEY
A Beginner's Guide to WordPress - WordCamp Montreal 2012
PPTX
css and wordpress
PPTX
css and wordpress
KEY
Week 1 Slides - Cosmology of the Modern WordPress Web
PPT
WordPress 2.5 Overview - Rich Media Institute
ODP
Wordpress as a CMS
PDF
WordPress Theme Structure
PDF
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
PDF
Everything You Need to Know about WordPress Themes
KEY
A Beginner's Guide to WordPress - WordCamp Toronto 2012
PDF
Blogluck1
PPTX
Introducing Cascading Style Sheets
PDF
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
PDF
Build Your Own Website A Comic Guide to HTML, CSS and Wordpress (Nate Cooper)...
Crafting Custom CSS @ PodCamp Toronto 2015 #PCTO15
Word Press As A Cms
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
Cosmology of the web - Lecture 1
HTML/CSS for WordPress
Beginners' Guide to WordPress
A Beginner's Guide to WordPress - WordCamp Montreal 2012
css and wordpress
css and wordpress
Week 1 Slides - Cosmology of the Modern WordPress Web
WordPress 2.5 Overview - Rich Media Institute
Wordpress as a CMS
WordPress Theme Structure
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
Everything You Need to Know about WordPress Themes
A Beginner's Guide to WordPress - WordCamp Toronto 2012
Blogluck1
Introducing Cascading Style Sheets
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Build Your Own Website A Comic Guide to HTML, CSS and Wordpress (Nate Cooper)...
Ad

More from Andy McIlwain (9)

PPTX
WordPress for All - WordCamp Rochester 2019
PPTX
From Post to Podcast: PodCamp Toronto 2019
PPTX
Embracing Gutenberg | WordCamp Rochester 2018
PPTX
Content Creators Toolbox #WCTO16
PPTX
Content Creation Regimen - WordCamp Hamilton 2016
PPTX
Creating Communities - PodCamp Toronto 2016
PPTX
10 Steps to Build a Business Website for Under $100
PPTX
Marketing Automation with WordPress #MarketersUnbound
PPTX
The Publishing Side of WordPress
WordPress for All - WordCamp Rochester 2019
From Post to Podcast: PodCamp Toronto 2019
Embracing Gutenberg | WordCamp Rochester 2018
Content Creators Toolbox #WCTO16
Content Creation Regimen - WordCamp Hamilton 2016
Creating Communities - PodCamp Toronto 2016
10 Steps to Build a Business Website for Under $100
Marketing Automation with WordPress #MarketersUnbound
The Publishing Side of WordPress

Recently uploaded (20)

PPTX
sap open course for s4hana steps from ECC to s4
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Machine learning based COVID-19 study performance prediction
PDF
Empathic Computing: Creating Shared Understanding
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Spectroscopy.pptx food analysis technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Understanding_Digital_Forensics_Presentation.pptx
sap open course for s4hana steps from ECC to s4
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectral efficient network and resource selection model in 5G networks
Machine learning based COVID-19 study performance prediction
Empathic Computing: Creating Shared Understanding
Unlocking AI with Model Context Protocol (MCP)
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Review of recent advances in non-invasive hemoglobin estimation
Spectroscopy.pptx food analysis technology
Chapter 3 Spatial Domain Image Processing.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Approach and Philosophy of On baking technology
Building Integrated photovoltaic BIPV_UPV.pdf
MYSQL Presentation for SQL database connectivity
Programs and apps: productivity, graphics, security and other tools
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Understanding_Digital_Forensics_Presentation.pptx

Intro to WordPress Theming

  • 1. Intro to WordPress Theming Andy McIlwain (www.andymci.com) Techalicious +TorontoWordPress Group Crafting Custom CSS | @andymci | #PCTO152015-04-06 1
  • 2. Hi! I’m Andy McIlwain. Developer at: Brainrider Marketers Without Borders Events& Instructor/Mentor at: Camp Tech Ladies Learning Code Organizer with: Toronto WordPress Meetups WordCamp Toronto Find me online: @andymci on Twitter linkedin.com/in/andymci instagram.com/andy.mcilwa in Crafting Custom CSS | @andymci | #PCTO152015-04-06 2
  • 3. Prerequisites. Let’s get some fundamentals out of the way first. April 4, 2015 WordPress Theming | @andymci | #WPTO 3
  • 4. How do websites work? 1. User asks for site. You punch a URL into your browser’s address bar. 3. Code sent to the browser. The server does its thing sends the website code back the user’s browser. 2. Computer looks for the site. It connects to the server through the magic of the internet. 4. Browser displays the site. User’s browser puts the returned code (HTML, CSS, and JavaScript) together to display the website.Crafting Custom CSS | @andymci | #PCTO152015-04-06 4
  • 5. Here’s a visualization… 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 5 User ServerBrowser Enters Website URL Connects to Server Returns Website CodeDisplays Website
  • 6. So what’s loading in the browser, anyway? Let’s take a closer look… April 4, 2015 WordPress Theming | @andymci | #WPTO 6
  • 7. The Structure of a Website Server: Generates site code. HTML: The webpage structure and content. CSS: Rules that control the “look and feel” of the JavaScript: Adds interaction, effects, and additional functionality. Server HTML CSS JavaScript 2015-04-06 7
  • 8. It’s like building a house! Server HTML CSS JavaScript Foundation Framing, Flooring, Drywall Fixtures, Carpeting, Paint Electrical, Plumbing, HVAC Crafting Custom CSS | @andymci | #PCTO152015-04-06 8
  • 9. We choose what to build on. Server HTML CSS JavaScript Foundation Framing, Flooring, Drywall Fixtures, Carpeting, Paint Electrical, Plumbing, HVAC Crafting Custom CSS | @andymci | #PCTO152015-04-06 9
  • 10. Then we set up the structure. Server HTML CSS JavaScript Foundation Framing, Flooring, Drywall Fixtures, Carpeting, Paint Electrical, Plumbing, HVAC Crafting Custom CSS | @andymci | #PCTO152015-04-06 10
  • 11. Set up controls and interaction. Server HTML CSS JavaScript Foundation Framing, Flooring, Drywall Fixtures, Carpeting, Paint Electrical, Plumbing, HVAC Crafting Custom CSS | @andymci | #PCTO152015-04-06 11
  • 12. Then we make everything pretty. Server HTML CSS JavaScript Foundation Framing, Flooring, Drywall Fixtures, Carpeting, Paint Electrical, Plumbing, HVAC Crafting Custom CSS | @andymci | #PCTO152015-04-06 12
  • 13. What about WordPress? April 4, 2015 WordPress Theming | @andymci | #WPTO 13
  • 14. How does WordPress work? 1. Server-side software. You install WordPress on the server where the site will 3. Method to manage content. WordPress back-end (wp- is where we can safely content in the database. 2. Generates webpages. WordPress pulls content from a database, adds HTML/CSS/JS. 4. Extend with themes, plugins. Themes control look, feel, and functionality. Plugins control functionality. Crafting Custom CSS | @andymci | #PCTO152015-04-06 14
  • 15. WordPress on your Server Database: Where content and site options are stored. WordPress: Core software, connects to the database. Theme: Controls the appearance of your website. one theme can be active at a time. Plugins: Adds additional functionality to your site. Database WordPress Theme Plugins Crafting Custom CSS | @andymci | #PCTO152015-04-06 15
  • 16. Here’s a visualization… 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 16 User ServerBrowser Enters Website URL Connects to Server Returns Site CodeDisplays Website Runs WordPress
  • 17. How do we install WordPress? One-Click Install. The fastest method. most shared hosting Managed hosts. Managed WordPress hosts, WP Engine or Flywheel, have WordPress pre-installed. Manual installation. Technical, best suited for more advanced users. (Creating DB, uploading WordPress files via FTP, editing wp-config.php.) Crafting Custom CSS | @andymci | #PCTO152015-04-06 17
  • 18. WordPress Lingo 101 Posts Can be categorized and Associated with a date, time, author. Suitable for articles, posts, blogs. Categories & Tags (Taxonomies) Categories have a hierarchy. do not. Pages Can have a hierarchy. Can be assigned templates (if supported by a theme). Suitable for content that changes infrequently. Page Templates Unique to a theme. Designates different page layouts or functionality. Crafting Custom CSS | @andymci | #PCTO152015-04-06 18
  • 19. More Lingo! Permalinks Unique URL for every piece content on your site (posts, pages, archives, etc…) Themes Handle the appearance of site, plus some functionality. Plugins Extend the functionality of a site. Can be simple (contact forms) or complex (e- commerce). The Codex The go-to resource. Find it @ codex.wordpress.org Crafting Custom CSS | @andymci | #PCTO152015-04-06 19
  • 20. Let’s Talk Themes The best things in life are (often) free. April 4, 2015 WordPress Theming | @andymci | #WPTO 20
  • 21. wordpress.org/themes/ • Browse and search for themes that meet specific criteria. • Read reviews, see what people are saying about the themes. • Check for a direct “Theme Homepage” link.Theme author sites usually have better previews, documentation. 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 21
  • 22. What makes for a good theme? Clean Layout Easier to add your own flare images and custom CSS. Available Reviews, Examples See how the theme is being “in the wild”. Look for from existing users. Well Documented Includes inline documentation (comments in code). Crafting Custom CSS | @andymci | #PCTO152015-04-06 22
  • 23. My favourite theme: Make • Drag-and-drop builder for quickly building complex page layouts without code. • Can target unique IDs and classes to add custom CSS. • Opportunities for advanced development with hooks and filters. • Pro version offers even more! 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 23 https://wordpress.org/themes/make/
  • 24. Customizing Themes with CSS Dipping our toes into the waters of theme development. April 4, 2015 WordPress Theming | @andymci | #WPTO 24
  • 25. Remember this stack? Server HTML CSS JavaScript Crafting Custom CSS | @andymci | #PCTO152015-04-06 25 Controlled by the theme. Database WordPress Theme Plugins
  • 26. Let’s drill into the CSS. Server HTML CSS JavaScript Crafting Custom CSS | @andymci | #PCTO152015-04-06 26
  • 27. CSS CSS stands for Cascading Style Sheets.They control the “look and and feel” of web pages. If we were building a house, CSS would be in charge of laying the carpet and painting the walls. Key points to remember: • CSS sets appearance rules for HTML • Targets elements, classes, and IDs • Rules wrapped in “curly brackets” { like this } body { background: white; font-family: Arial, sans- serif; } #head { background: black; color: white; } #content p { font-size: 14px; margin: 10px 0; } Crafting Custom CSS | @andymci | #PCTO152015-04-06 27
  • 28. How HTML & CSS Work Together When your browser loads a page, it looks at the elements on the page and checks if there are CSS rules for those elements. Key points: • HTML uses id and class • CSS uses # and . • When we see id, we target with # • When we see class, we target with . HTML CSS <div id=“header”> </div> #header {} <div class=“post”> </div> .post {} Crafting Custom CSS | @andymci | #PCTO152015-04-06 28
  • 29. Connecting HTML & CSS HTML CSS <body> <div id=“header”> </div> <div id=“content”> <div class=“post”> </div> </div> <div id=“footer”> </div> </body> body {} #header {} #content {} .post {} #footer {} Crafting Custom CSS | @andymci | #PCTO152015-04-06 29
  • 30. Getting More Specific HTML CSS <div class=“post”> <h2>Post Title</h2> <p>Paragraph of content.</p> </div> .post {} <div class=“post”> <h2>Post Title</h2> <p>Paragraph of content.</p> </div> .post h2 {} <div class=“post”> <h2>Post Title</h2> <p>Paragraph of content.</p> </div> .post p {} Crafting Custom CSS | @andymci | #PCTO152015-04-06 30
  • 31. What Rules Can We Use? Some Example Rules What It Does background-image: url(…) Defines background image. float: left; Positioning relative to subsequent elements. background-color: #fff; Defines background color. font-family: Arial, sans-serif; Defines the font to use. font-size: 24px; Defines the size of the font. font-weight: bold; Defines the weight of the font. color: red; Defines the colour of the font. width: 400px; Defines the width of the targeted element. height: 400px; Defines the height of the targeted element. Find more rules at tympanus.net/codrops/css_reference/ Crafting Custom CSS | @andymci | #PCTO152015-04-06 31
  • 32. Inspecting Other’s Work • Your browser comes equipped with DeveloperTools • You can inspect page code • You can play with code that only affects your browser Here’s how you do it in Firefox, Chrome, Internet Explorer, and Safari. Crafting Custom CSS | @andymci | #PCTO152015-04-06 32
  • 33. How can we apply custom CSS? Plugins Jetpack’s Custom CSS Simple Custom CSS Theme Options Some themes include support for applying custom CSS. Crafting Custom CSS | @andymci | #PCTO152015-04-06 33
  • 34. Baby Steps to Theme Building: 1. Inspect your theme. 2. Find IDs and classes. 3. Apply custom CSS. 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 34
  • 35. Starter Themes vs. Theme Frameworks (Kicking customization up a notch.) April 4, 2015 WordPress Theming | @andymci | #WPTO 35
  • 36. What’s the difference? Starter Themes • Download the code and modify it to create a new theme from scratch. • Future updates to the starter theme will not affect older themes you created with the starter theme. Theme Frameworks • A parent theme that you do not edit directly. Your theme will be a child of the framework theme. • Future updates to the framework (parent theme) are inherited by your theme (the child theme). 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 36
  • 37. e.g. Underscores vs. Genesis 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 37 http://underscores.me/ http://my.studiopress.com/themes/genesis/ Starter Theme Framework
  • 38. What’s a child theme? Child themes build on top of other themes. They inherit and override code from the parent theme. From the Codex: • If you modify a theme directly and it is updated, then your modifications may be lost. By using a child theme you will ensure that your modifications are preserved. • Using a child theme can speed up development time. • Using a child theme is a great way to to learn aboutWordPress theme development. 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 38 FYI: Genesis themes are all child themes of the Genesis theme framework.
  • 39. Next Steps to Theme Building: - Choose starter theme or framework. - Modify starter theme, or - Create framework child theme. 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 39
  • 40. Building Your Own Theme From Scratch (It’s not as hard as it sounds!) April 4, 2015 WordPress Theming | @andymci | #WPTO 40
  • 41. Wireframing: Paper to Pixels 1. Block it out. Start with a simple layout of blocks. 3. Add details & variations. Once you’ve locked in on an approach, start modifying different purposes. 2. Give each block a job. Header, footer, sidebar, post. Start simple, gradually build up. 4. Make it digital. Use an app to share, collect feedback, make modifications. 2015-04-06 41
  • 42. For example… We start by blocking it out. 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 42
  • 43. Then we give each block a job. The basics: Header, Content, Footer. 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 43 Header Footer Content
  • 44. Then we modify. Here’s a home page. 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 44 Logo Footer Welcome Message Intro Video Upcoming Events Navigation
  • 45. Then we modify. Here’s a list of events. 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 45 Logo Footer Event Navigation Event Event Promos
  • 46. Then we modify. Here’s a single event. 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 46 Logo Footer Event Navigation Promos
  • 47. Note the blocks that don’t change. 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 47 Logo Footer Event Navigation Promos Logo Footer Event Navigation Event Event Promos Logo Footer Welcome Message Intro Video Upcoming Events Navigation We’ll be coming back to these in a bit…!
  • 48. Create an HTML & CSS Mockup Turn layouts into HTML files. You can do all of this on computer, no PHP required. Style everything in style.css This is your chance to nail much of the design as you Add placeholders. Use placeholders for images, text, and additional markup. Link files together. You can create a semblance of “user flow” linking from HTML file to HTML file. (e.g. homepage to post, homepage to page).2015-04-06 48
  • 49. Need a primer on good design? 2015-04-06 49 http://learndesignprinciples.com http://goodui.org Oldie but a goodie: http://www.smashingmagazine.com/2008/01/31/10- principles-of-effective-web-design/
  • 50. Get the following: FTP app to move files. I recommend Filezilla. App for editing images. Photoshop CC or GIMP (free). Editor app to work with code. I recommend Sublime Text. A running WordPress site. What good is a theme if you don’t have a site to test it on? 2015-04-06 50
  • 51. How do we begin theming? Start with the basics. Minimum requirements: index.php and style.css Add template tags to index.php In WordPress, template tags just PHP functions. Here’s a listing of template tags. Add theme info to style.css This header information is checked for theme details. Install in WordPress! Put your theme files in a folder under /wp- content/themes/. 2015-04-06 51
  • 52. Tags You Should Know <?php wp_head(); ?> / <?php wp_footer(); ?> Sets “hooks” for WordPress core, plugins, and themes to inject additional code into the header or footer of the site. (Here’s some more info about hooks and filters in WordPress.) <?php bloginfo(‘###’); ?> Retrieves all sorts of information about your site. Link e.g. Site title, theme directory, admin email. 2015-04-06 Crafting Custom CSS | @andymci | #PCTO15 52
  • 53. The WordPress Loop “Loops” through the database, finds content, displays it according to the tags you’ve defined in the loop. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> // Post Content Here // <?php endwhile; else : ?> <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p> <?php endif; ?> 2015-04-06 53
  • 54. Let’s build a theme! - Wireframes are our guide. - We’ll build a prototype in HTML. - Then transform it into a theme. 2015-04-06 54 (Cue live demo alt-tab!)
  • 55. Next Steps Where do we go from here…? April 4, 2015 WordPress Theming | @andymci | #WPTO 55
  • 56. Ideas for next steps: Build your first theme. Create a theme and submit the WordPress Theme Contribute to a theme. The beauty of open source you can make improvements things other people have Build a simple site for a friend. This is how many people get started w/ professional work. Review others’ work. Crack open what others have built and learn from their work. 2015-04-06 56
  • 57. Theme Development Resources ThemeShaperTutorial Theme Development (Codex) WordPressTemplateTags WordPress Code Reference WordPress Coding Standards WordPressTheme Review Guide WordPress Answers VIP Best Practices Developer Plugin GenerateWP WP Gear Skeleton Boilerplate XAMPP Balsamiq Crafting Custom CSS | @andymci | #PCTO152015-04-06 57
  • 58. Useful CSS Tools & Resources CSS Reference MDN CSS Reference CoDrops CSS Reference Inspiration CSS Tricks CSS Zen Garden CSS Mania Courses Codecademy CSS Course CodeSchool CSS Treehouse CSS Basics Useful Tools CodePen Skeleton Crafting Custom CSS | @andymci | #PCTO152015-04-06 58
  • 59. Thank You! Questions? Slides will be posted online: www.slideshare.net/andymci Find me online: www.andymci.com | @andymci | linkedin.com/in/andymci Crafting Custom CSS | @andymci | #PCTO152015-04-06 59

Editor's Notes

  • #31: Be more precise with your CSS rules! - Look at surrounding elements. - Look at types of elements.
  • #42: Do a demo with Google Drive.
  • #49: Do a demo with Google Drive.
  • #51: Do a demo with Google Drive.
  • #52: Do a demo with Google Drive.
  • #57: Do a demo with Google Drive.
  • #58: Do a demo with Google Drive.