Child Theme

21
Child Themes WordPress Meetup Bangkok, 2014/08/17 Shinichi Nishikawa

description

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

Transcript of Child Theme

Page 1: Child Theme

Child ThemesWordPress Meetup Bangkok, 2014/08/17

Shinichi Nishikawa

Page 2: Child Theme

What is a Child Theme?

Page 3: 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.

Page 4: 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.

Page 5: 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.

Page 6: Child Theme

Codex

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

Page 7: Child Theme

Parent Theme?

Any WordPress themes can be a Parent Theme.

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

Page 8: Child Theme

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.

Page 9: Child Theme

Demo 1

Parent Theme: Twenty Fourteen

Child Theme: Shin 2014

Page 10: Child Theme

Concept of Child Theme

Don’t reinvent the wheel.

Change only what you need.

Protect changes from theme updates.

Page 11: Child Theme

Override

You can override 3 things

1. css

2. template files

3. functions in functions.php

Page 12: Child Theme

1. Override css

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

Page 13: Child Theme

Demo 2

Parent Theme: Twenty Thirteen

Child Theme: nu2013

https://wordpress.org/themes/nu2013

Example: nskw-style.com

Page 14: Child Theme

2. Override template files

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

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

Page 15: Child Theme

3. Override functions.php

2 ways.

1. add functions.→ example in nu2013

2. override functions.→ devdmbootstrap3

Page 16: Child Theme

Demo 3

Parent Theme: devdmbootstrap3

Child Theme: devdmbootstrap3-child

https://wordpress.org/themes/devdmbootstrap3

Page 17: Child Theme

Child Themes vs Theme Frameworks.

Page 18: Child Theme

Theme Framework Examples

Underscores: underscores.me

Roots: roots.io/starter-theme

Page 19: Child Theme

Which to choose?

Page 20: Child Theme

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 )

Page 21: Child Theme

Theme Framework?

When you create from scratch.

When you have your own design.

When you change a lot from the original theme.