Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Child theme won't work

  • Avatar of mareksgregs
    mareksgregs
    Participant

    @mareksgregs

    I have a site that I’d like to change up a little. And I found that a child theme would be the best way to do it.
    So I created one. Activated it. But any changes I make have no effect.

    Could someone please guide me trough making it work?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Depends on what exactly you’ve done/tried. Detail your process thus far so people can get an idea of what might have gone wrong. At the moment you haven’t given anything to go on.

    Avatar of mareksgregs
    mareksgregs
    Participant

    @mareksgregs

    All right so,

    1. I created a new theme folder in wp-content/themes
    2. Then I created style.css with the following in it,

    /*
    Theme Name:     The Buzz
    Theme URI:      http://site.com
    Description:    Child theme for Buddypress Default
    Author:         Name here
    Author URI:     http://site.com
    Template:       bp-default                             
    Version:        0.1.0
    */
    
    @import url("../bp-default/style.css");
    
    #contentwide
    {
    margin: 5px 35px 0;
    font-size: 1.2em;
    width: 880px;
    float: left;
    display: inline;
    height: 400px;
    }
    
    body {
    background-color: #eaeaea;
    background-image: url(../images/background.gif );
    background-repeat: repeat-x;
    background-position: top left;
    color: #555;
    font-size: 12px;
    font-family: Arial, Tahoma, Verdana, sans-serif;
    line-height: 170%;
    max-width: 1250px;
    margin: 0 auto;
    width: 95%;
    }
    
    #site-generator {
    font-weight: bold;
    color: rgb(54, 54, 54);
    margin: 20px 20px;
    text-align: right;
    text-shadow: #fafafa 1px 1px 0;
    }
    
    #footer-widget-area div.widget-area > ul {
    height: 110px;
    float: left;
    margin-right: 2.5%;
    width: 23%;
    }

    3. Added that file to the folder I just made.
    4. Activated the Child theme in Dashboard -> Appearance -> Themes

    And that’s about it. Nothing happened.

    Avatar of Brandon Moeller
    Brandon Moeller
    Participant

    @brandonmoeller

    I am also experiencing this problem with a very simple child theme. It is my theory that with BuddyPress 1.7 – and with now the plugin doing all of the heavy lifting of applying BuddyPress styles on top of any theme – that it doesn’t work well with Child themes, whereas, when it loads an activated child theme, it chooses to load the parent / template theme only.

    I hope I’m making sense. I don’t know where to begin looking in the BuddyPress code to see where the problem is coming from – but if it could be fixed, I’d sure appreciate it. Using child themes makes the world a better place and allows us to painlessly update our parent / template themes.

    Otherwise, 1.7 is leaps ahead of where BP used to be and I’m looking forward to getting it working on my site. Soon.

    Avatar of Brandon Moeller
    Brandon Moeller
    Participant

    @brandonmoeller

    Nevermind what I said – I no longer believe it to be true. It works just fine on another child theme I just tested it on. My problem, I believe, concerns a parent theme that doesn’t use the style.css file in the traditional way – it’s likely that with more work on my child theme, I could get it to work with BuddyPress.

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    @mareksgregs

    And that’s about it. Nothing happened.

    That needs to be qualified. What exactly didn’t happen or more precisely what did you expect to happen?

    When you create a child of bp-default or any child for that matter you inherit the parents functions.php as well as templates this means in the case of bp-default the CSS and JS are all included/enqueued so you do not need to do an @import and in reality the path for that import would fail as that’s not correct.

    If you’re looking for style changes then you will probably need to ensure you’re styles or ruleset selectors have a higher weight( more selectors in the selector set ) than the BP ones which will load later overwriting yours if using exact same selectors.

    Avatar of mareksgregs
    mareksgregs
    Participant

    @mareksgregs

    @hnla
    I expected my child theme’s css to replace the parent. But it didn’t. None of the ids I have in style.css replaced the parent.
    And yes, I’ve come to realize that the import tag isn’t doing much either. I removed it yesterday.

    I don’t kow what are these ruleset selectors. How do I place them? Where do I place them?

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    You’ll need to read up on CSS ‘Specificity’ or selector ‘weight’

    briefly CSS dscribes a Cascade of rules, if you have a stylesheet stating:

    body {background: blue;}

    then one after stating:

    body {background: red;}

    The later wins out background is red.

    however add ‘html into the selector set of the first:
    html body {background: blue;}

    And it will hold true, you have been more specific also you have weighted the value of you selectors (all selectors, classes, id’s have a numeric value which is added together to arrive at a single value that if higher than another dictates the higher is to be used.)

    A selector is the identifier that tells the properties in the ruleset which elements they should be applied to. always preceding the first ‘{‘ white space in-between selectors is also a selector named ‘descendent’ it signifies that the last selector (on the right) has the other selectors as parents or ancestral elements i.e it’s nested in those.

    Avatar of mareksgregs
    mareksgregs
    Participant

    @mareksgregs

    Oh thanks!
    But it seems that the problem was not much of a problem after all.
    I simply had to rename my child theme’s folder. Because apparently, you can’t have space between words. “My Theme” for example wouldn’t work. haha.

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Spaces don’t exist they were never allowed, it was only Windows/MS that ballsed up the protocols to allow them. Never ever have spaces in file names or folder names stick to strict Unix conventions.

    Avatar of John Conner
    John Conner
    Participant

    @johnconner

    @mareksgregs I had such problem, just little more complicated, the only thing is nobody -even experts and developers- can directly give the clue in harsh times. Have a look here, might be helpful: http://www.buddyboss.com/child-themes/

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

You must be logged in to reply to this topic.