Child Theme did not inherit styles from parent

Support Area Forums Forward Child Theme did not inherit styles from parent

Viewing 12 posts - 1 through 12 (of 12 total)
URL to the page in question:
  • Author
    Posts
  • #28781
    Anna
    Participant

    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
    Anna

    #28823
    Bill Robbins
    Moderator

    Hello 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,
    Bill

    #28924
    Anna
    Participant
    #28932
    Bill Robbins
    Moderator

    Thanks 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,
    Bill

    #28961
    Anna
    Participant
    #28964
    Bill Robbins
    Moderator

    Thanks 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,
    Bill

    #28983
    Anna
    Participant

    The file does come up. I posted its contents

    https://gist.github.com/anonymous/3ac0e36dd60d9b10a164

    #28984
    Bill Robbins
    Moderator

    If 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?

    #28986
    Anna
    Participant

    The 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 size

    attached are two images so you can see the difference 1) the parent theme and 2) the child theme

    #28989
    Bill Robbins
    Moderator

    Gotcha. 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.

    #29011
    Anna
    Participant

    That 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.

    #29014
    Bill Robbins
    Moderator

    It 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.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Child Theme did not inherit styles from parent’ is closed to new replies.