Child Themes in WordPress


Web Development

Updated Dec 2nd, 2019

Create a new theme folder and rename it “OldThemeName-Child”. The folder must contain a style.css file with some boilerplate and a functions.php file with some pasted code from the internet. Activate from the WordPress Dash Board > Appearance > Themes. Making changes to the Child Theme files will prevent you from losing any customization if the theme is updated.

Note from Child Themes Lynda Video 7/7

Some parent themes are better than others (2016 or any WordPress default themes is a good idea because they have been code reviewed a ton and have WP feature sets and built for child theming ease). Popper is used by instructor in this course. Popper was created using underscores (in another lynda video).

Simple to set up

New folder in themes called popper-child (naming convention). Created CSS stylesheet and that needs two components within the comments at the top.
/*
Theme Name: (X child Theme)
Template: (Parent theme Name)
*/
Additional are theme uri, descritpion. Author, author uri, version number).

From this point you will have craigslist like styles (aka none) and you can choose to 1.) Overwrite or 2.) Override.

1.) Copy everything from below initial comment and paste in. Not great because of future updates.

2.) Reference original then write out changes.

Referencing using
!no!@import url(“../parentname/style.css”);

—-
Be lazy. Do as little as possible and reuse code if possible. Look for existing code from parent or elsewhere and tweak to make custom changes.
—-
Left off on designing in the browser.
—-


Top