Support » Theme: Twenty Fourteen » Child theme mess it up

  • Resolved ilievpavel

    (@ilievpavel)


    I’ve come to the conclusion that I better make my child theme before it is too late. I did made child-folder of my theme with style.css inside.
    The problem comes when I activate the child theme, everything is rearranged.

    I’ve also tried to show the way to my parent style.css,
    @import url(“../twentyfourteen/style.css”);
    even with the full adress. I’ve double checked the Theme Name and Template which are the only required.[correct me if I’m wrong]

    How can I fix this? Do I have to start everything from the beginning?
    I’ve red about comparing the two style.css files or something like that, but I prefer to hear from you first guys.

    And a last question which might not be suitable for the topic. A google+ link appears over my header. Is that the analytics which I’ve added to my parrent?

    My url is http://greatapp101.com/
    Currently I’m using the parent theme.

    Thank you in advance,
    Pavel

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hey there.

    I took a look at your site and then realised you mentioned it’s back on the parent now, because of that I can’t see what’s occurring exactly.

    You can read more about creating a child theme here:

    http://premium.wpmudev.org/blog/create-wordpress-child-theme/

    If I was to guess what the issues was I’d think the original css was not included, or the path was somehow wrong.

    Once enabled again I’ll take another look. 🙂

    As for the social icon, it looks like you’re using some plugin like AddThis. It adds social icons on the right there, I guess when you try to use the child because the theme doesn’t look right it’s somewhere else in case.

    Take care.

    I’ve noticed that the sample style.css in the updated instructions for a child theme has this section:

    /*
    For older themes, and themes that do not use wp_enqueue_style() to enqueue their stylesheet, use the following line where twentyfourteen is the name of the directory where the theme resides:
    
    @import url("../twentyfourteen/style.css");
    */

    But when I tried creating a child theme with the above example (using the latest WP version and the latest TwentyFourteen version), the parent theme wasn’t being imported (which is why your site didn’t look right). Try changing that section in your child style.css file so it looks like this:

    /*
    For older themes, and themes that do not use wp_enqueue_style() to enqueue their stylesheet, use the following line where twentyfourteen is the name of the directory where the theme resides:
    */
    @import url("../twentyfourteen/style.css");

    That is, take the @import url statement outside of the comment tags. That should bring in your parent theme’s style.css file.

    Thread Starter ilievpavel

    (@ilievpavel)

    This is it, lol it was easier than I tought. Thanks.

    How could I check which changes from the parent are missing in the child and add them? Also does the custom css manager edit the child or parrent?

    Have a wealthy day,
    Pavel

    Excellent, as I mentioned then it seems the original CSS wasn’t included.

    How could I check which changes from the parent are missing in the child and add them?

    If it’s now being included then all the styles should be there, you shouldn’t need to add them back in.

    You can now however start adding in your own styles to alter or extend the originals.

    Also does the custom css manager edit the child or parrent?

    You can edit any theme, on the top right there is a Select theme to edit drop down. Then all the files appear below that drop down.

    Although css is generally safe to edit there, I wouldn’t recommend editing PHP, it’s easy to make a mistake and then take your site offline. Using FTP and a decent editor will let you revert changes easily. I know you’re not editing PHP here but just wanted to throw that out there in case 🙂

    Take care and have a great day!

    Thread Starter ilievpavel

    (@ilievpavel)

    Many thanks to both of you!

    Topic resolved!

    How could I check which changes from the parent are missing in the child and add them?

    As Tim mentioned, everything from the parent style sheet should be imported, so nothing should be “missing.” If there isn’t a rule in the parent stylesheet which does what you want, then you add it in the child theme’s stylesheet.

    Also does the custom css manager edit the child or parrent?

    Are you using a Custom CSS plugin? If you have a child theme, then there is no need to use a Custom CSS manager, you just add your new CSS to the child theme’s style.css file. However, to answer your question, usually a custom CSS plugin will add its own stylesheet (either inline or an external link) after the child theme’s stylesheet, so any rules in the custom CSS stylesheet will override any similar rules (those with an identical specificity) in the child theme style sheet.

    You should also read about CSS specificity so you understand how to write your own selectors in a way that will properly override any existing CSS rules.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Child theme mess it up’ is closed to new replies.