Child Theme

Preview:

DESCRIPTION

This is the slide I used for WordPress Meetup Bangkok Aug 2014

Citation preview

Child ThemesWordPress Meetup Bangkok, 2014/08/17

Shinichi Nishikawa

What is a Child Theme?

CodexA child theme is a theme that inherits the functionality of another theme, called the parent theme. !Child themes allow you to modify, or add to the functionality of that parent theme. !A child theme is the best, safest, and easiest way to modify an existing theme.

CodexA child theme is a theme that inherits the functionality of another theme, called the parent theme. !Child themes allow you to modify, or add to the functionality of that parent theme. !A child theme is the best, safest, and easiest way to modify an existing theme.

CodexA child theme is a theme that inherits the functionality of another theme, called the parent theme. !Child themes allow you to modify, or add to the functionality of that parent theme. !A child theme is the best, safest, and easiest way to modify an existing theme.

Codex

Child Theme:http://codex.wordpress.org/Child_Themes

Parent Theme?

Any WordPress themes can be a Parent Theme.

Exception: You can’t make a Child Theme of another Child Themes.

How to make a child theme

1. Create a folder in wp-content/themes

2. Put style.css with“Template: ParentThemeDirName”in Comment.

3. Add what you want.

Demo 1

Parent Theme: Twenty Fourteen

Child Theme: Shin 2014

Concept of Child Theme

Don’t reinvent the wheel.

Change only what you need.

Protect changes from theme updates.

Override

You can override 3 things

1. css

2. template files

3. functions in functions.php

1. Override css

a presentation by Brandon Dove. http://www.slideshare.net/brandondove/parentchild-themes-vs-theme-frameworks/5

Demo 2

Parent Theme: Twenty Thirteen

Child Theme: nu2013

https://wordpress.org/themes/nu2013

Example: nskw-style.com

2. Override template files

If Child Theme has a template file, WordPress uses that.

If not, WordPress uses a template file in Parent Theme.

3. Override functions.php

2 ways.

1. add functions.→ example in nu2013

2. override functions.→ devdmbootstrap3

Demo 3

Parent Theme: devdmbootstrap3

Child Theme: devdmbootstrap3-child

https://wordpress.org/themes/devdmbootstrap3

Child Themes vs Theme Frameworks.

Theme Framework Examples

Underscores: underscores.me

Roots: roots.io/starter-theme

Which to choose?

Child themes?

When you find a good parent theme.

And it’s almost what you want.

And you need to change a little bit.

( When the budget is very small )

Theme Framework?

When you create from scratch.

When you have your own design.

When you change a lot from the original theme.

Recommended