To create a child theme and safely make changes that will overwrite a parent theme, do this:
- create a new directory in your themes folder (this will contain your child theme files)
- use a text editor (e.g. Notepad++) to create a new file in the folder you just created named ‘style.css‘
- put this at the top of the file
/*
Theme Name: My New Theme
Description: Child theme for the blogolife theme
Author: Your name here
Template: blogolife
*/
@import url("../blogolife/style.css");
#menu-item-962 a {
color:#3d21eb;
font-size:2rem;
}
** The template line connects the child theme to a parent (in this case blogolife). If a file isn’t found in your child theme, WordPress will reference the file in the parent.
** The import line gets styles from the parent theme
** ‘#menu-item-962 a’ targets your Fishing Contest link which has an id of ‘menu-item-962’. Styles go inside the { } The color and font-size are just examples I added, change them to fit your theme.
in admin, navigate to Appearance | Themes. Find the child theme you created and click ‘Live Preview‘ to preview your site and see the new styles you created for the Fishing Contest link.
When it looks the way you want it to look, click ‘Activate’.
Add any future changes to your child theme style.css. That keeps them from being overwritten if you ever update blogolife.
For example, to change the color of your side links to orange, add this to your child theme style.css
.widget ul li a {
color: #FAA61C;
}
In this example, the child theme is overwriting line 852 of it’s parent theme (found in themes/blogolife/style.css) where the link color is set to #666