setting up a child theme
-
I installed the theme Oyster and I want to make some changes that won’t be overwritten by updates. My page is https://www.w-ard.com
I’ve read a child theme is the best way, so I created one and activated it.
I have two questions now that it is more or less working.
1) When I want to make a change to a particular file, what is the best practice method? The parent “style.css” file only has about the same info as my child style sheet, and there is no code in there (just a header). The parent theme has subfolders named “core” “css” “ext” “img” “js” and has about 40 .php files in the root folder.
Do I re-create the file structure in my child folder and then copy any file I want to make changes to into those folders?
Once I find the particular spot in the .php or .css file, should change that attribute, but then delete the rest of the code in the file so that it doesn’t override any other code? I don’t want to override code that might get updated later by the parent theme and leave mine outdated by the child.2) It seems important to create the child functions.php because the www.remarpro.com site said I need it to enqueue the parent and child theme stylesheets. Especially since there are more than one .css files in the parent theme.
The problem is that I get the white screen of death when I have this file uploaded, so I deleted it for now. Here is the entire text of the child functions.php file:
<?php add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri(https://w-ard.com/wp-content/themes/gt3-wp-oyster/) . '/style.css' ); }
- The topic ‘setting up a child theme’ is closed to new replies.