week 9 - introduction to child themes

32
CA274 - Web Content Management Systems and Strategy* henri.makembe@montgomerycolleg e.edu

Upload: henrimakembe

Post on 28-Jan-2015

111 views

Category:

Education


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Week 9  - Introduction to Child Themes

CA274 - Web Content Management Systems and

Strategy*

[email protected]

Page 2: Week 9  - Introduction to Child Themes

1. Class website ca274.beekeeperdev.com

2. Google Group – Use to ask questions and share findings

Week 8 Recap

Page 3: Week 9  - Introduction to Child Themes

Week 8 Recap

Mid-term

Page 4: Week 9  - Introduction to Child Themes

Intro to WordPress ChildThemes

Week 9

Page 5: Week 9  - Introduction to Child Themes

Week 9 – Introduction to Child Themes

HMTLCSSJavaScriptPHP

For every site, a theme.

My-WP-Theme 1

HMTLCSSJavaScriptPHP

My-WP-Theme 2

HMTLCSSJavaScriptPHP

My-WP-Theme 3

HMTLCSSJavaScriptPHP

My-WP-Theme 3

Page 6: Week 9  - Introduction to Child Themes

Week 9 – Introduction to Child Themes

HMTLCSSJavaScriptPHP

This is the OLD way

My-WP-Theme 1

HMTLCSSJavaScriptPHP

My-WP-Theme 2

HMTLCSSJavaScriptPHP

My-WP-Theme 3

HMTLCSSJavaScriptPHP

My-WP-Theme 3

Page 7: Week 9  - Introduction to Child Themes

Week 9 – Introduction to Child Themes

HMTLCSSJavaScriptPHPTheme options

Introducing child themes…

My-WP-Theme(parent-theme)

CSSTwo or three PHP files

My-wp-child-Theme

Page 8: Week 9  - Introduction to Child Themes

What is a WordPress Parent theme? Any theme created by anyone No specific coding requirements

Week 9 - Introduction to Child Themes

Page 9: Week 9  - Introduction to Child Themes

What is a WordPress Child theme?

“A WordPress child theme is a theme that inherits the functionality of another theme, called the parent theme, and allows you to modify, or add to, the functionality of that parent theme.”

-The WordPress Codex

Week 9 - Introduction to Child Themes

Page 10: Week 9  - Introduction to Child Themes

Why use Child themes?• You don’t have reinvent the wheel

• Change only what you need

• Protects your modification from updates to parent theme (in theory)

• Unified architecture and development process

Week 9 - Introduction to Child Themes

Page 11: Week 9  - Introduction to Child Themes

How do child them work? Follow the same hierarchy as any WordPress

theme

Child theme can contain as many or as few files as you want

If template is not available in child theme directory, WP will look for it parent theme directory

Files in your child theme folder override files in the parent theme folder

Week 9 - Introduction to Child Themes

Page 12: Week 9  - Introduction to Child Themes

How do child them work? (Cont) Only requirement is a style.css

functions.php does not get overridden. (Adding a functions.php will add-to rather than override functions.php from your parent theme)

Week 9 - Introduction to Child Themes

Page 13: Week 9  - Introduction to Child Themes

Directory Structure

Week 9 - Introduction to Child Themes

Page 14: Week 9  - Introduction to Child Themes

Directory Structure

Week 9 - Introduction to Child Themes

Parent Theme Child Theme

Page 15: Week 9  - Introduction to Child Themes

Examples

Week 9 - Introduction to Child Themes

Page 16: Week 9  - Introduction to Child Themes

Examples

Week 9 - Introduction to Child Themes

Page 17: Week 9  - Introduction to Child Themes

Examples

Week 9 - Introduction to Child Themes

Page 18: Week 9  - Introduction to Child Themes

How to get started?...It’s easy. Choose in a parent theme

Create a new folder in /wp-content/themes/

Create CSS file in newly created folder.

Add @import call to parent CSS file

Week 9 - Introduction to Child Themes

There must be no other CSS rules above the @import rule. If you put other rules above it, it will be invalidated and thestylesheet of the parent will not be imported.

Page 19: Week 9  - Introduction to Child Themes

When Choosing a parent theme… Don’t just look at the design. Flexibility? Extra

functionality?

Premium vs. Framework vs. Codex

Is there a forum or structured system for support or bug reporting?

Well-written & commented code. Check to see if the X-HTML & CSS mark-up validates according to W3C standards.

Make sure that you fully understand how a Parent theme works

Week 9 - Introduction to Child Themes

Page 20: Week 9  - Introduction to Child Themes

Frameworks Supercharged parent theme

For developers

Usually highly widgetized

Uses action to allow child themes to execute code

User filters to allow child themes to modify output

Week 9 - Introduction to Child Themes

Page 21: Week 9  - Introduction to Child Themes

Some good parent themes / FrameworksListed on WP Codex http://codex.wordpress.org/Theme_FrameworksThematic Theme (free, developer friendly)http://themeshaper.com/thematic-for-wordpress/Hybrid Theme (free, paid support) http://themehybrid.com/Genesis Theme (premium, regular updates, developer friendly) http://www.studiopress.com/themesThesis Theme (premium, regular updates, highly customizable

Week 9 - Introduction to Child Themes

Page 22: Week 9  - Introduction to Child Themes

PRACTICE

Week 9 - Introduction to Child Themes

Page 23: Week 9  - Introduction to Child Themes

InstallWordPress(10 Minutes)

Week 6

Page 24: Week 9  - Introduction to Child Themes

CSS File

Week 9 - Introduction to Child Themes

* Template = folder name of the parent theme

Page 25: Week 9  - Introduction to Child Themes

Dashboard

Week 9 - Introduction to Child Themes

For bonus points, add a screenshot.png fileto your child theme folder. 300 x 225 pixels

Page 26: Week 9  - Introduction to Child Themes

Overriding style elements

Week 9 - Introduction to Child Themes

Parent Theme Child Theme

Page 27: Week 9  - Introduction to Child Themes

Overriding style elements

Week 9 - Introduction to Child Themes

Page 28: Week 9  - Introduction to Child Themes

Overriding functions

Week 9 - Introduction to Child Themes

Parent Theme

Child Theme

Page 29: Week 9  - Introduction to Child Themes

Resources Codex: Child Themeshttp://codex.wordpress.org/Child_Themes

How To Modify WordPress Themes The Smart Wayhttp://themeshaper.com/modify-wordpress-themes/

How to make a child theme for WordPress: A pictorial introduction for beginners

http://op111.net/53/

Week 9 - Introduction to Child Themes

Page 30: Week 9  - Introduction to Child Themes

Resources Codex: Child Themeshttp://codex.wordpress.org/Child_Themes

How To Modify WordPress Themes The Smart Wayhttp://themeshaper.com/modify-wordpress-themes/

How to make a child theme for WordPress: A pictorial introduction for beginners

http://op111.net/53/

Week 9 - Introduction to Child Themes

Page 31: Week 9  - Introduction to Child Themes

Homework Create a twentyeleven child theme

Add/change the background image of the body Change the background color of the sidebar Change the font weight, color Make post titles in all CAPS Hide category meta using CSS Anything else you want (optional)

Name of you child theme should be “firstname lastname child theme”

Email me the file(s) of child theme only. Make sure you receive confirmation from me.

Week 9 - Introduction to Child Themes

Page 32: Week 9  - Introduction to Child Themes

Sources http://www.slideshare.net/vegasgeek/intro-to-wordpress-child-

themes

http://www.slideshare.net/abanesta/child-theming-an-introduction-to-wordpress-theme-development-with-wordpress-child-themes

http://www.slideshare.net/saracannon/customizing-themeschildthemes

http://www.slideshare.net/brandondove/parentchild-themes-vs-theme-frameworks

http://www.slideshare.net/rfair404/wordpress-child-themes/

Week 9 - Introduction to Child Themes