Creating a Child Theme for Twenty Twelve (7 posts)

  1. GypsyNightshade
    Posted 3 years ago #

    I have been reading that I need to create a child folder for my theme as I want to make coding changes and have been following the instructions given by WordPress.org, but I feel I'm missing the obvious.

    I created a style.css stylesheet through Dreamweaver with the code:

    Theme Name: Twenty Twelve Child
    Theme URI: http://mydomainname.com/
    Description: Child theme for the Twenty Twelve theme
    Author: My Name
    Author URI: http://mydomainname.com/about/
    Template: twentytwelve
    Version: 0.1.0
    @import url("../twentytwelve/style.css");

    As I'm new to this type of coding, is there additional code below the @import url("../twentytwelve/style.css");

    Do I need to have a copy of the Twenty Twelve theme in the child folder and only change the first few lines of code in the style.css?


  2. Pioneer Web Design
    Posted 3 years ago #

    What the stylesheet in the child theme does is get loaded after the parent theme (and plugins) stylesheet(s)...so when you add rules to it, they override those...

  3. GypsyNightshade
    Posted 3 years ago #

    Correct, I guess I'm again missing something obvious. Do I create a copy of the theme renaming it "Child" and then adding said code to the style.css to overwrite the parent? Or is there simply a style.css sheet in the child folder with just the code I listed above?

  4. Pioneer Web Design
    Posted 3 years ago #

    No, just create an empty folder named twentytwelve-child, then add to it your stylesheet file, style.css, go to appearance>themes>you will now see your child theme>activate it.

    At first it will look just the same as the parent, until you add those over-riding styles I mentioned...or a custom page template, custom functions.php file...

  5. GypsyNightshade
    Posted 3 years ago #

    Thanks! Though the preview on the Theme area is blank, over all it works, yet the header does not appear. For the function.php file editing, is there a tutorial that you know of on how I can do that as not to mess up the original theme?

  6. WPyogi
    Forum Moderator
    Posted 3 years ago #

    If you mean that the header you set in the parent theme does not show up - yes, that's likely as theme settings and options don't all carry over to the child...you have to redo those.

    As to functions.php - it depends on what you are adding or changing. General info - http://codex.wordpress.org/Child_Themes#Using_functions.php

  7. GypsyNightshade
    Posted 3 years ago #

    That worked, thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic