• Resolved BHasbrouckpri

    (@bhasbrouckpri)


    so i finally created a child theme but i want to add all the other templates, styles, and pictures (specifically the comments bubble) to my site (www.ipoliticalrisk.com). does anyone know how to do that?! i’ve been searching the internet for 2 hours trying to figure this out. any help would be much appreciated!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • If you’ve created your minimal child theme, with just a comment block and a single line that imports the parent theme’s style sheet, it should look and behave exactly like its parent until you make changes to it. You simply carry out the configurations in the same way as you would for the parent theme.

    So if there’s a comments bubble in your parent theme, there’ll be a comments bubble in the child.

    What would mess things like this up would be if you’d copied everything from your parent’s style sheet into your child style sheet, because the parent style sheet contains a rule like this:

    .entry-header .comments-link a {
      ...
      background-image: url("images/comment-bubble.png");
      ...
    }

    So this is expecting to find the file comment-bubble.png in a directory directly underneath the one in which the style sheet resides. It won’t find it, of course, because the directory is actually off the parent theme’s directory.

    You only use your child style sheet to add new rules, not to repeat the ones that already exist in the parent.

    Cheers

    PAE

    Thread Starter BHasbrouckpri

    (@bhasbrouckpri)

    Thanks! So what do I do to have it reference that? do I restart my child theme? I don’t know exactly how I did that.

    Your child theme should contain nothing copied from your parent theme’s style sheet. It should contain, as the first line after the comments block, the statement:

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

    It may contain some style rules after that, but none of them will have been copied from the twentyeleven style sheet. The only style rules in the child’s style sheet will be extra ones you have added either as extra rules or as rules that override, i.e. change, rules in the parent.

    If that’s the case, you will not have to do anything other than get rid of all the duplicate style rules from your child’s style sheet. The comment bubble will be found because it will be relative to the parent theme’s style sheet and not relative to yours.

    As things stand, FireBug reckons that the rule I referred to is on line 1000 of the style sheet at:

    http://www.ipoliticalrisk.com/wp-content/themes/politicalrisk-theme/style.css

    In other words the rule is in your child theme’s style sheet. Neither it nor any of the other rules that are in there as duplicates of the parent should be there.

    Once that’s sorted the rules should all work properly, possibly after a refresh of the page in the browser.

    HTH

    PAE

    Thread Starter BHasbrouckpri

    (@bhasbrouckpri)

    So I think I finally get it. I leave the child theme css sheet alone unless I want something to override a parent theme setting? that’s why i was screwing so much up.

    what’s “hth” mean?

    thanks a lot for all your help! really appreciate it!

    BH

    Yep. Either override or add to. But definitely no repeats. For a child theme to work, its style sheet does not need to contain anything at all except for the comment block at the top of the file and the @import statement. A minimal style sheet like that will look and behave exactly like its parent.

    HTH = “Hope that helps”

    Cheers

    PAE

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘child theme adding php and png’ is closed to new replies.