WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Child Theme Problems importing Parent style.css (14 posts)

  1. craignimbusits
    Member
    Posted 1 year ago #

    Hi, thanks in advance for your help.

    I'm new to WordPress and I've been stuck on this all afternoon. I created a Child theme for the tutorial http://codex.wordpress.org/Child_Themes

    Worked fine up until I added the @import url("../twentytwelve/style.css"); it made no difference to my theme - its still has no style - its blank a part from the written content.

    I know there are lots of threads on here about this problem but the ones I've read don't seem to have helped me.

    My site is nimbus-its.co.uk
    My host is ipage

    this is my style.css file

    /*
    Theme Name: Twenty Twelve Child
    Theme URI: http://www.nimbus-its.co.uk/
    Description: Child theme for the Twenty Twelve theme
    Author: Craig W. Hunt
    Author URI: http://www.nimbus-its.co.uk/
    Template: twentytwelve
    Version: 0.1.0
    */

    @import url("../twentytwelve/style.css");

    thank you for your help

  2. leejosepho
    Member
    Posted 1 year ago #

    Do you have a copy of Twenty Twelve in your themes folder? The default Twenty Twelve and your Twenty Twelve Child Theme should reside side-by-side at /wp-content/themes/.

  3. craignimbusits
    Member
    Posted 1 year ago #

    Thanks for the reply.

    I have Twenty Twelve as it was when I first installed WordPress: /wp-content/themes/twentytwelve/style.css

    My child theme is /wp-content/themes/my-twentytwelve/style.css

    But I couldn't get the @import url("../twentytwelve/style.css"); to work

    However, in the mean time I tried to use the One Click Child Theme Plug in - I think it seems to have worked.... Although I still have the same message which is:

    This child theme requires its parent theme, Twenty Twelve.

    But the site appears as it should this time- identical to Twenty Twelve, because I've made no changes yet. I'm testing it now to see what happens when I make changes to the style.css file that the plugin created

    The plugin made another css file rtl.css (see below)

    /*
    Theme Name:     My twentytwelve
    Template:       
    
    Right to Left text support.
    */
    @import url("../twentytwelve/rtl.css");

    I still feel defeated though as I followed the instructions and I still failed.

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    It looks like your current child theme is working fine. The second one is for right to left languages - just delete it if it's not relevant.

  5. leejosepho
    Member
    Posted 1 year ago #

    This child theme requires its parent theme, Twenty Twelve.

    That is a normal message when all is well. Does your Child Theme name match the name of its folder? I do not remember exactly what must match where, but something like that might be the issue there.

  6. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    If you have any plugins active, try deactivating them to see if they are causing the error message.

  7. craignimbusits
    Member
    Posted 1 year ago #

    Ok, I'm going to bed now but in the morning I'll delete the style.css file that the one click plugin created and create my own again and deactivate all my plugins before I do it.

    Perhaps I'll try that too, lee. but the only difference in the folder name is there is no space betweeen twenty and tweleve I could try 'twenty-twelve'

    Thank you both very much

  8. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    The way it's set up now looks to be working - have you tried changing the styles in the child theme? Have a good sleep - morning often helps :).

  9. craignimbusits
    Member
    Posted 1 year ago #

    Thanks for your reply.

    This morning I had another go at it but this time I created a child theme for twenty eleven. It worker perfect, I changed the site name to red and it worked fine.

    So I thought I'll try again for twenty twelve. I managed to import the parent theme this time, great I thought, but I couldn't change the style with code. It's probably just me - I'm new to wordpress and writing code (or copying other peoples because I can't write my own).

    example of the code I added to change the style

    #site-title a { color: #D22929; }

    and that was after the @import but it didn't do anything! I suppose I can't complain as twenty eleven seems to be working. Also, twnenty eleven seems to be better as well as it has footer widget areas already.

    It would be nice to know why it didn't work though.

  10. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Twentytwelve doesn't use the same CSS selectors - try this:

    h1.site-title a {
        color: #009900;
    }
  11. craignimbusits
    Member
    Posted 1 year ago #

    Great - thanks

    Well this code business is going to be a adventure isn't it.

    One more question, I was reading a tutorial for adding a widget footer area for twenty twelve. It said I could copy the the functions.php and footer.php from the parent theme into the child theme before I edit the code within them but as soon an I copy over the .php files the site crashes with a 500 internal sever error.

    Have I made a stupid mistake?

  12. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Yeah, the footer.php gets copied as is, but with functions.php, it's a bit more complicated -- see this:

    http://codex.wordpress.org/Child_Themes#Using_functions.php

    If you need more help on adding the widget, why don't you start a new thread and then someone (who's a better coder than I am :) ) can give you a hand with that. Including a link to the tutorial would be good too.

  13. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    A couple more hopefully helpful bits on the CSS - this is a good reference site:

    http://www.w3schools.com/css/

    Your best friend for working with CSS is a tool such as Firebug - as it shows you what's going on with the CSS for a specific element on the page and you can test changes in the browser before making them in the actual site code.

  14. craignimbusits
    Member
    Posted 1 year ago #

    thanks you're a life saver

Topic Closed

This topic has been closed to new replies.

About this Topic