• Resolved HuDuYuDesign

    (@huduyudesign)


    I’m testing free version of Sugar and Spice, had trouble creating child theme, researched forum & found to use One Click Child Theme plugin. This worked as far as allowing child theme, however, while activated main theme is still controlling the CSS. I inserted only changes I made.

    Suggestions on how to fix? Considering going to paid version but very concerned with difficulties found in using child theme so far.

    Thanks for your input.

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

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Child Themes inherit all the CSS from their parent theme so it’s normal to see the parent theme’s CSS still controlling the site.

    Thread Starter HuDuYuDesign

    (@huduyudesign)

    Thank you Andrew. The problem is the child theme css is not over ruling the parent. Below is my child css. Here is link, theme is set to child. https://webeartist.net/movedstyle/ If I put the changes below back into parent, then I get changes I’ve made.

    /*
    Theme Name: Sugar and Spice Child Theme
    Description:
    Author: Susan
    Template: sugar-and-spice

    (optional values you can add: Theme URI, Author URI, Version)
    */

    @import url(“../sugar-and-spice/style.css”);

    /* =Theme customization starts here
    ————————————————————– */

    /* 02. Page Layout
    ================================================== */
    #page:after {
    content: ”;
    width: 1008px;
    height: 30px;

    background-repeat: no-repeat;
    background-position: bottom left;
    background-size: cover;
    display: block;
    }
    #page:before {
    content: ”;
    width: 1008px;
    height: 35px;

    background-repeat: no-repeat;
    background-position: top left;
    background-size: cover;
    display: block;
    }
    #header {

    background-repeat: repeat-y;
    background-position: top left;
    background-size: contain;
    position: relative;
    }
    #main {

    background-repeat: repeat-y;
    background-position: top left;
    background-size: contain;
    padding: 3em 34px;
    overflow: hidden;
    }

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Which style specifically isn’t working?

    Thread Starter HuDuYuDesign

    (@huduyudesign)

    In each of styles I pasted in post, background image is removed (example: background-image: url(“images/hfbg.png”);) removing border around main template. So in all of them, they are still showing the background border even though removed in child theme.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I checked one of them:

    #header {
    
    background-repeat: repeat-y;
    background-position: top left;
    background-size: contain;
    position: relative;
    }

    And they were showing.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    There is no style that removes the background image, what do you mean? Do you mean you copied the parent theme’s CSS into your Child Theme and then just deleted the line of CSS?
    E.g. you copied this:

    #header {
    background-image: url(...);
    background-repeat: repeat-y;
    background-position: top left;
    background-size: contain;
    position: relative;
    }

    And then deleted the background image line in your Child Theme style.css file:

    #header {
    
    background-repeat: repeat-y;
    background-position: top left;
    background-size: contain;
    position: relative;
    }

    ??

    Thread Starter HuDuYuDesign

    (@huduyudesign)

    Yes, I originally worked on parent theme as I had trouble creating child manually & getting WP to recognize. Then researched more & found the plugin to create it. Once that worked I just moved over part of code I had changed. Maybe I’m doing something wrong/backwards… just not had this much trouble with a child theme before.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    The Child Theme style.css file will only override the parent theme if you specify so. That means unless you tell “#header” for example to have no background image then it will continue to have one as the parent CSS will be used.
    So you need to tell “#header” not to use a background image:

    #header {
     background: none;
    }

    Thread Starter HuDuYuDesign

    (@huduyudesign)

    Seems to work if I put in background-image: url(“”); and remove the url.

    I am new to blogging and wondering how to make a child theme, have no web designing experience.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Child Theme’ is closed to new replies.