Notes on a WordPress Child Theme
source link: https://nixmash.com/on-wordpress/notes-on-a-wordpress-child-theme/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
We’re starting a new collection of blog posts on customizing WordPress called Series Twenty Seventeen. It’s called Series Twenty Seventeen because we’ll be starting with the out-of-the-box version of the WordPress Twenty Seventeen Theme and modifying it to suit our needs.
WordPress Child Themes in Two Paragraphs
Pretty much everything you need to know about WordPress Child Themes can be found on the WordPress Theme Handbook located here. The basic steps in created a Child Theme are 1) you add your theme folder, 2) specify a parent theme (which for us is Twenty Seventeen) in your style.css and 3) add a functions.php file.
Other basic traits of a WordPress Child Theme are that your functions.php file executes after the parent theme functions.php and any .php file you replace in the Parent Theme ([theme]/template-parts/content.php for example) is executed IN PLACE OF the Parent Theme file.
Child Theme in Action
The Home Page of Twenty Seventeen is pretty cool, with a full-page image that can also be used to display video, as I understand it.
We don’t want that though. We want a masthead that only covers half of the home page. To do that we’re going to update our Child Theme style.css. Because our Child Theme CSS file(s) are loaded after the Twenty Twenty Seventeen Parent CSS files, our job is done.
And there we are!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK