-
jalex11Participant
Hi again. Very new to this and in steep learning curve. Thanks for any advice you might have:
I wanted to use a Child theme so when I am trying to customize my site, I don’t mess up the original files. Right now I just have a style.css file that I am using. However, When I add code it doesn’t reflect any change in my site.
Any ideas?
Jos KleverParticipantI figured out the use of child themes just recently so I hope I can help you with this. What have you created in your child theme by now?
1. create a new folder like myTheme in your themes folder
2. create the file style.css in that folder with code like:
/*
Theme Name: myTheme
Theme URI: http://example.com/
Description: Child theme for the Esplanade theme
Author: Your name here
Author URI: http://example.com/about/
Template: esplanade
Version: 0.1.0
*/
@import url(“../esplanade/style.css”);3. Be sure you use the correct name of the parent theme as Template.
4. Activate the child theme in WordPress. Your site should now look exactly like the esplanade theme. (remove the @import line to see your site without any styles)
5. Create extra style rules in your style.css to customize the looks…
6. To customize an existing file in the parent theme: copy the file to your child theme and edit it there.
7. To customize functions.php: create a new functions.php in your child theme with your own code. Important: both versions of functions.php will be loaded, first the one in your child theme and then the one in the parent theme. You can redefine a function in your child theme, but make sure there’s a check in the parent theme like:
if ( ! function_exists( ‘function_name’ ) ) …jalex11ParticipantThank you so much for trying to help! I tried to reset the parent theme changes I had made through the editor, and I think I got it working.
But having trouble changing color of menu. I read in another post that something like:
#access li.current_page_item > a {
Won’t be able to be changed because of the > character. I was hoping editing in a child theme in style.css would solve the problem, but I don’t think it has.
- This reply was modified 12 years, 5 months ago by jalex11.
Jos KleverParticipantYou can redefine every style by copying the appropriate rules, but you need more than one rule to change the colors.
Tip: In Google Chrome: Right-click on any page element and select Inspect element. Now you can see which styles are used to show the selected element.
See also: https://developers.google.com/chrome-developer-tools/Daniel TaraKeymasterThe limitation with the > character applies only if you are changing styles through Appearance > Theme Options > Design. You should be able to do any modifications in your own style.css.
Decide if you want to customize the entire stylesheet. In that case copy the style.css from the parent theme and get rid of the @import rule. If you want to build upon the original stylesheet then keep the @import but keep in mind that all rules must be cascaded (i.e. rules from the original stylesheet must be overridden).
Tagged: child theme
You must be logged in to reply to this topic.