WordPress Child Themes

Revision as of 14:07, 6 January 2021 by Root (talk | contribs) (Created page with "It has proven very difficult to find simple information about creating a Child Theme for WordPress website. This article is oriented towards people that are familiar and comf...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

It has proven very difficult to find simple information about creating a Child Theme for WordPress website. This article is oriented towards people that are familiar and comfortable with WordPress (themes, etc.), programming, etc.

So here it is a very quick answer to create a Child Theme...

Creating & Enabling a Child Theme

  • Create a directory in the website's ./wp-content/themes directory. It can be any name.
    • Suggestion (not a requirement): Name the Child Theme directory in such a manner that it is obviously connected to a Parent Theme directory.
      • Example: Parent Theme is "twentyfourteen", Child Theme: twentyfourteen.child
      • Note: Remember Linux is case sensitive, so a directory named "twentyfourteen" is not the same as "TwentyFourteen". Also keep in mind that may not apply for a WAMP stack (look it up) on Windows as that wasn't tested.
  • Key Point: A Child Theme is connected to a Parent Theme via the default Cascading Style Sheet (CSS) in the above created directory, named: style.css
    • The style.css file contains two key lines:
      • Theme Name: twentyfourteen.child (This is name of the Child Theme. It is suggested that it be the same as the directory name of the Child Theme, but it doesn't have to be)
      • Template: twentyfourteen (This is the actual name of the directory (not just the name of the theme) in ./wp-content/themes that contains the Parent Theme)

https://kinsta.com/blog/wordpress-child-theme/