Support » Themes and Templates » When child theme is activated the formatting is wrong

  • connorrizza

    (@connorrizza)


    I’ve spent a while now trying to create a child theme and I need help!

    I am using the ‘twenty eleven’ theme so I created a folder in the ‘themes’ directory called ‘twentyeleven-child’ I then ctreated a style.css using the following example:

    \/*
    Theme Name: Twentyeleven Child
    Description: Child theme for the twentyeleven theme
    Author: Your name here
    Template: twentyeleven
    */

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

    But when I activate the theme file, it’s all messed up. the colors are the same, but none of my formatting is there.

    Can anyone help? Here’s my site:

    http://www.everythingbutordinary.co.uk

    I have the understanding that you are supposed to create a child theme before any changes are made to the parent theme but I have only recently heard about child themes so I have already made quite a few changes to the parent theme.

    Please Help!
    Connor

Viewing 13 replies - 1 through 13 (of 13 total)
  • Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Can you activate your Child Theme

    connorrizza

    (@connorrizza)

    Yes I have just activated it.

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Okay so your Child Theme style.css file isn’t this:

    /*
    Theme Name: Twentyeleven Child
    Description: Child theme for the twentyeleven theme
    Author: Your name here
    Template: twentyeleven
    */
    
    @import url("../twentyeleven/style.css");

    Can you double-check it and make sure it’s correct?

    connorrizza

    (@connorrizza)

    Sorry this is the head of the style.css of the child theme:

    /*

    Theme Name: Twenty Eleven Child
    Theme URI: http://example.com/
    Description: Child theme for the Twenty Eleven theme
    Author: Your Name
    Author URI: http://example.com/about/
    Template: twentyeleven
    Version: 1.4

    */

    Below the head I have copied what is in the ‘style.css’ of the parent theme below the head and pasted it into the ‘style.css’ of the child theme under the head.

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Yeah don’t do that, do this:

    /*
    Theme Name: Twentyeleven Child
    Description: Child theme for the twentyeleven theme
    Author: Your name here
    Template: twentyeleven
    */
    
    @import url("../twentyeleven/style.css");

    connorrizza

    (@connorrizza)

    I have done that now but the problem still persists!

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    So it looks like the modifications made to the parent theme were not just in the parent theme’s style.css file, otherwise they would have all been ‘@import‘ed in to your Child Theme style.css file.

    Can you remember where else the modifications were made?

    connorrizza

    (@connorrizza)

    Oh right that makes sense. No I can’t remember where all modifications were made as I have only recently heard about child themes and realised that I have been doing it wrong. I can remember making changes to the ‘functions.php’ but I also know that multiple other files have been modified in the past.

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Try spotting the difference between the original theme’s files, that you suspect of having modifications, and your parent theme’s files.

    This is a good spot-the-difference tool: http://www.diffchecker.com/

    For easy reference the original Twenty Eleven version 1.4 theme files can be found here:
    http://themes.svn.wordpress.org/twentyeleven/1.4/

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    When you find differences could you select “Store difference forever” from the dropdown too? So that you can share us that Diffchecker page with the comparison.

    connorrizza

    (@connorrizza)

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Although those differences will need to be transferred into your Child Theme I’m not sure that’s the cause of the issue you saw.

    Try copying over the “js” and “inc” folders into your Child Theme directory

    connorrizza

    (@connorrizza)

    Hi Andrew,
    Yes your right, after copying both ‘inc’ and ‘js’ files to the child theme the problem is still there when the child theme is activated.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘When child theme is activated the formatting is wrong’ is closed to new replies.