WordPress.org

Forums

When child theme is activated the formatting is wrong (14 posts)

  1. connorrizza
    Member
    Posted 1 year ago #

    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

  2. Andrew
    Forum moderator & snail smusher
    Posted 1 year ago #

    Can you activate your Child Theme

  3. connorrizza
    Member
    Posted 1 year ago #

    Yes I have just activated it.

  4. Andrew
    Forum moderator & snail smusher
    Posted 1 year ago #

    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?

  5. connorrizza
    Member
    Posted 1 year ago #

    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.

  6. Andrew
    Forum moderator & snail smusher
    Posted 1 year ago #

    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");
  7. connorrizza
    Member
    Posted 1 year ago #

    I have done that now but the problem still persists!

  8. Andrew
    Forum moderator & snail smusher
    Posted 1 year ago #

    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?

  9. connorrizza
    Member
    Posted 1 year ago #

    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.

  10. Andrew
    Forum moderator & snail smusher
    Posted 1 year ago #

    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/

  11. Andrew
    Forum moderator & snail smusher
    Posted 1 year ago #

    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.

  12. connorrizza
    Member
    Posted 1 year ago #

  13. Andrew
    Forum moderator & snail smusher
    Posted 1 year ago #

    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

  14. connorrizza
    Member
    Posted 11 months ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic