Child Theme did not inherit styles from parent
Support Area › Forums › Forward › Child Theme did not inherit styles from parent
- This topic has 11 replies, 2 voices, and was last updated 9 years ago by Bill Robbins.
-
AuthorPosts
-
April 11, 2015 at 04:59 #28781AnnaParticipant
Hi Bill,
I followed your instructions on installing the One-Click Child Theme plugin and creating a child theme. My style.css file did not have the import line it as expected. I added the the line to the child theme’s style.css file – but still the styles from the Forward theme are missing.
The line I added was:
@import url(“../forward/style.css”);any suggestions? I am running on localhost.
Thanks
AnnaApril 13, 2015 at 09:14 #28823Bill RobbinsModeratorHello Anna,
One of the things that’s changed with the one-click plugin is it has stopped loading styles from the parent theme via an @import line. Instead it’s using a function to load the parent theme’s style.css file. Someone mentioned that was preferable so the author of the plugin made a change.
If you want to post each file from the child theme to https://gist.github.com I’ll be glad to take a look at them since they’re not online yet. Make a separate Gist for each file and then post the URL to each one back here.
Take care,
BillApril 14, 2015 at 18:57 #28924AnnaParticipantHi Bill,
Thanks for taking a look. I hope this is what you wanted to see.
https://gist.github.com/anonymous/b750a0aa661c5392eec5
April 14, 2015 at 20:50 #28932Bill RobbinsModeratorThanks for doing that. I didn’t see anything there that looked amiss; which is good and bad.
Could I get you to make one more Gist for me. View the front page of your site. Right click on it and view the source of it. Copy that and make one more Gist with the full source code to your front page. Hopefully that’ll shine a light on what’s not connecting.
Thanks,
BillApril 15, 2015 at 14:52 #28961AnnaParticipantFront page gist:
April 15, 2015 at 15:02 #28964Bill RobbinsModeratorThanks Anna. I took a look and found this line:
<link rel='stylesheet' id='parent-style-css' href='http://localhost/houselink/wp-content/themes/forward/style.css?ver=4.1.1' type='text/css' media='all' />
which is loading the parent theme’s style.css file. Since the styles aren’t present, that would seem to indicate that either the file can’t be read from that URL (could be a permission issue) or that the file isn’t there.
Try going to this URL directly in your browser: http://localhost/houselink/wp-content/themes/forward/style.css
and see if the file comes up or if you get an error. If it’s an error, that may be a clue as to what’s wrong.
But I will say that looks like a correct URL; it’s pretty much would I would expect to see there.
Let me know what you come up with,
BillApril 15, 2015 at 20:20 #28983AnnaParticipantThe file does come up. I posted its contents
April 15, 2015 at 20:43 #28984Bill RobbinsModeratorIf the file is coming up then that means that the parent theme’s styles are being imported properly by the child theme. What are you running into that you’re not seeing from the parent theme?
April 15, 2015 at 21:27 #28986AnnaParticipantThe cityscape image is missing
The top menu is missing
The attention widget on front page is missing
All home widgets are missing
Only the slider works properly
The footer is double the sizeattached are two images so you can see the difference 1) the parent theme and 2) the child theme
Attachments:
April 15, 2015 at 21:37 #28989Bill RobbinsModeratorGotcha. From WordPress’ perspective, a child theme is still a new theme. That means that you’ll still need to set your options in the customizer, add your widgets to the home page and assign your navigation menu to the theme’s menu location.
Your navigation menu should still be saved so assigning it should be all you need to do. The widgets will likely be in the inactive widgets section in your widget admin.
Try setting those items and let me know if you run into trouble.
April 17, 2015 at 04:12 #29011AnnaParticipantThat was a pretty obvious thing I hadn’t realized :). Thanks for the clarification. I just assumed everything should have cascaded down even though I had noticed that the widgets were not there in the child theme. I appreciated your speedy responses. The site looks great now.
April 17, 2015 at 08:38 #29014Bill RobbinsModeratorIt would seem like WordPress would keep those in place when using a child theme. Makes sense to me. Glad I could help out. If you need anything else, just let me know.
-
AuthorPosts
- The topic ‘Child Theme did not inherit styles from parent’ is closed to new replies.