• Just started on WordPress and am now on using child themes to customise a parent theme. I’ve followed the coding rules and used the code below, but while using the last seven lines of code does what it’s supposed to do – wipe out the parent style; when I go back and add the first line of code – @import url (‘../twentyten/style.css’); – to get the child theme to use the parent theme style, nothing happens, there is no import of parent theme style. Any ideas? All folders have been correctly added in the right places. I’m on a Mac and I’m using Komodo as my text editor.

    Thanks in advance.

    @import url (‘../twentyten/style.css’);
    /*
    Theme Name: Child of TwentyTen
    Theme URI: http//www.?.com
    Description: This is my first child theme
    Author: john kimon
    Template: twentyten
    /*

Viewing 15 replies - 16 through 30 (of 36 total)
  • Thread Starter john kimon

    (@john-kimon)

    Okay, Chip: all that’s in my child theme CSS style file, is this:

    @import url (‘..shaan/style.css’);

    /*
    Theme Name: Child of Shaan
    Theme URI: https://www.?.com
    Description: My first child theme
    Author: johnkimon
    Template: shaan
    */

    I’ve tried it with the first line after the comment code but it makes no difference. I’ve tried it with the shaan, twentyten and twentyeleven themes and on Firefox and in Safari. Still nothing. I will try in the morning ClaytonJames’ suggestion. Really grateful for everyone’s help. I’m determined to prevail.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    John, it’s the import line. When I copied yours verbatim I got the same thing you’ve gotten.

    You have this (assuming the formatting wasn’t munged in the paste)

    @import url ('..shaan/style.css');

    Which has a space after the url and is missing the / after the ..

    After I corrected it the child theme works for me.

    /*
    Theme Name: Child of Shaan
    Description: My first child theme
    Author: johnkimon
    Template: shaan
    */
    
    @import url('../shaan/style.css');

    You can download this from pastebin.com using the download link on top. Save the style.css.txt less the .txt extension.

    Edit: Also with all the child theme’s I’ve seen, the @import and CSS customization comes after the comment header. Not sure if that matters but you may want to try it that way too.

    Edit Edit: Doh! That’s what Clayton already said.

    Thread Starter john kimon

    (@john-kimon)

    Thanks Jan and Clayton: you were right. It was the import line. I changed it by removing the space between the url and the bracket and added / after .. and, hey presto! Brilliant. Thanks again for all your help. I’m a novice on wordpress and was going to chuck it all in, but you saved the day. Much appreciated.

    Must have just been a weird copy-paste issue. Glad you got it going!

    Thread Starter john kimon

    (@john-kimon)

    Yes, I’m trying to build my custom theme now. Thanks again.

    my child theme erased the content from the parent theme!! PLEASE HELP!

    This should be in a new topic.

    Please post a link to your site so we can see the child theme style sheet (amongst other things).

    Does everything work OK when you return to your previous theme?

    Apart from the style.css file, what other files do you have in your child theme’s directory?

    Cheers

    PAE

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @myshkin1, Please post your own topic with your own details.

    Hi,

    My child theme (Blaskan)does not look like my parent theme. I think it may be because I made changes to the parent theme before making the child theme. I’ve tried to correct it by deleting my parent theme and reinstalling it so that I can make a child theme from the new, unaltered Blaskan parent theme. But it reinstalled the theme with my changes intact (even despite the message stating that I may lose any customization since Blaskan has been updated). How can I get my child theme to look like my parent theme; or at least how can I re-install it without it keeping my changes? Thanks anyone.

    My strategy would be:

    1. Change to a default theme like twentytwelve
    2. Remove the Blaskan theme from the wp-contents/themes directory
    3. Make a local copy of your child theme
    4. Remove your child theme from the wp-content/themes directory
    5. Go to Dashboard -> Themes -> Install and search for the blaskan theme
    6. Install the theme from the search results
    7. Activate the blaskan theme just to prove all is well
    8. Upload your copy of your child theme
    9. Activate your child theme

    That should do it.

    HTH

    PAE

    Sorry – posted twice in error

    PAE

    Thanks so much. The only thing is, is that when I installed the Blaskan theme again, it kept my changes. I want to get an unaltered version of Blaskan ’cause I’m assuming that I should then have little difficulty making my child theme look like the parent theme.

    That’s why I’m saying to download a fresh copy via the “Install New” theme page.

    Cheers

    PAE

    Hi all, I’ve had this same issue as well and I just can’t get my twentytwelve child theme to look like it’s default twentytwelve parent.

    Here’s what I’ve got uploaded to my cyberduck child theme folder –

    /*
    Theme Name: Twenty Twelve Child
    Description: Child theme for the Twenty Twevle
    Author: Ian
    Template: twentytwelve
    Version: 0.1.0
    */

    @import url(“../twentytwelve/style.css”);

    It has the menu but nothing else (see below)-

    Menu

    Skip to content
    Home
    About
    Blog
    Epsiodes
    Gallery
    Mission
    Podcast
    No posts to display

    Ready to publish your first post? Get started here.

    Participants

    Participants
    Proudly powered by WordPress

    Any advice would help, I’ve done everything in the comments above already.

    Thanks

    Isn’t the default theme called ‘twentyeleven’?

    Cheers

    PAE

Viewing 15 replies - 16 through 30 (of 36 total)
  • The topic ‘Can't get child theme to use parent theme style’ is closed to new replies.