Copy and paste this into the style. Next, you will need to include some information about your theme. Keep in mind, it has to be named style.css for things to work right. Then save the stylesheet and your CSS will be live. The next, very crucial step is creating the child theme’s stylesheet. You can delete the default text so that your CSS only appears in the editor. Now paste your CSS directly to the default text. There are many online tools to check that your CSS is valid, including W3Schools CSS. Here is the screen with basic CSS editor. See, most of my pages include a header and a footer template: <. You can eventually revert to the regular function before going live, but it can be extremely helpful during production. Go to Appearance > Edit CSS from your WordPress Dashboard. '/style.css' ) instead, which adds a version number after the stylesheet corresponding to the timestamp from the last time you saved your child stylesheet, instead of the true "Version" declared in that stylesheet.
Copy the site-info.php file from the parent theme over to the footer folder in your child theme. So add a folder called template-parts, then add another folder folder inside template-parts called footer. You can change this behavior by swapping wp_get_theme()->get('Version') (the $ver parameter) for the handy filemtime( get_stylesheet_directory(). Replicate the folder structure from the parent theme (Twenty Seventeen) inside the child theme. The drawback is that it prevents you from ever seeing your edits even after refreshing / clearing cache, unless you change the "Version" number in your css file after every edit. Open up the functions.php file in a text editor and look for the last occurrence of wpregisterstyle, then add a new line below it as follows: wpregisterstyle ('custom', gettemplatedirectoryuri (). Thus for Divi, you would enqueue theme like this: get('Version')Īdd_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ) īrowsers have an annoying tendency of caching the child stylesheet depending on its "Version". To clarify this, for anyone using Divi theme (but generally any WP theme), a simple inspection using Dev tools on the "head" for the stylesheet links usually gives a clue about the handle, as Den Isahac mentioned previously (it wasn't clear as he mentioned it can't be found).Īnything before the "-css" on the ID of the link for the stylesheet of the Parent theme is generally that handle.Įxample below with Divi, id="divi-style-css" thus $handle = 'divi-style"