WordPress.org

Ready to get started?Download WordPress

Forums

Child Theme seems to be activated but not in Header? (11 posts)

  1. xxjohnboy
    Member
    Posted 3 months ago #

    Hi,

    I have read this wonderful post for my problem http://wordpress.org/support/topic/child-css-not-overriding-parent-stylesheets but still can't quite figure out my issue.

    I am using the musicspace theme and I have created a child theme and it is active in wordpress. Yet when I went to override the css styling it was not happening. I did some research online where I found the above post which looked good.

    But then I noticed when I view the source code for my page, there is no link at all to my child style sheet. I also am not able to override using the !important rule. So this seems pretty strange to me.

    Why is it that I can activate the child theme in wordpress but it does not show up in the header for the page? My site is at http://johnwilkinsonmusic.com.au/ and the .css file in my child theme is as follows

    /*
    Theme Name:     Child Music Space
    Theme URI:
    Description:    Child theme for the Music Space theme
    Author:         John Wilkinson
    Author URI:
    Template:       musicspace
    Version:        0.1.0
    */
    
    // This @import line loads the stylesheet from the parent theme
    @import url("../musicspace/style.css");
    
    // Now we can override styles from the parent theme...
    
    h1, h2, h3, h4, h5, h6, a.post_ttl {
    	color: #ff0000;
    }
  2. xxjohnboy
    Member
    Posted 3 months ago #

    Hi, so following on from this. I decided to do away with the MusicSpace theme entirely and try a different one, namely the soundwavesSE theme. As before I have created a child theme and it is active, but nowhere in the source of my page at http://www.johnwilkinsonmusic.com.au does it say it is accessing any style sheet from the child theme. Everything is coming straight from the parent theme.

    This obviously means I can not override and of thee css styling which is starting to get me pretty annoyed now.

    Would LOVE a pointer in the right direction.

    Thanks

  3. mlddev
    Member
    Posted 3 months ago #

    Have you reviewed WP documentation on how to setup a Child Theme information already?

  4. stephencottontail
    Member
    Posted 3 months ago #

    When I look at the source of your page, on line 11 or so (right after <meta name="viewport" content="width=device-width">), I see:

    <link rel="stylesheet" href="http://johnwilkinsonmusic.com.au/wp-content/themes/designfolio-child/style.css" type="text/css" media="screen">

    Is that not the link to your child theme's stylesheet?

  5. xxjohnboy
    Member
    Posted 3 months ago #

    Hi Stephen,

    Thanks for your response and excuse my delay. I tend to time box working on the site to save me getting overly aggravated :P

    After I posted here, I decided to try yet another theme, which was the DesignFolio theme, this one seems to work. I have not dug around in it too much yet, but I am pretty sure it is because all the styling is in one style sheet, where as both the other themes I used had multiple style sheets.

    It would have been nice to use the themes that are made for music, but I cannot seem to make that happen. I have already spent 6 hours stuffing around with Child Themes (learning from scratch though) so unless someone has a solution I guess I will just have to use a theme that doesn't reference multiple style sheets.

    I'll play around now for 2 hours and see what I have at the end, and then post pack. :)

    Thanks.

  6. EMG
    Forum Volunteer
    Posted 3 months ago #

    Hi there! :)

    When you're doing Child Themes and overriding CSS, the overriding CSS -NEEDS- to be pretty much a copy of the Parent's CSS with your choices specified as opposed to the Parent's.

    If, for example, the size of a box could be targeted by either a #specific-box or .not-specific-box selector and the PARENT chose to target the size using .not-specific-box, then to override correctly, you need to target using the .not-specific-box, too.

    Basically, a Child Theme is a literal copy of the Parent in terms of formatting/selector targeting when it comes to CSS. It is the specifics within that is different such as colors, dimensions, backgrounds.

    You CAN target the Parent's CSS of multiple stylesheets... but especially in these cases, you MUST target correctly by matching your CSS formatting to the Parent's CSS.

    Edit: On occasion, you will discover that some setup in the Parent Theme will override Child Theme styling in which case !important is needed.

    And sometimes even THEN, depending on how much in-theme customization it offers on its own re: color choices, layout choices, and how Child Theme friendly a theme is, a Child Theme may continue experiencing trouble with overrriding the Parent as there is oftentimes a function which is applying CSS (like, from theme options if the theme offers options) in real-time which almost guarantees to override previous CSS.

    In such a case, the theme options would be the 'child' and it and your own 'child' would be in conflict as to who is going to be applied or not.

    Hope this makes some sense.

  7. xxjohnboy
    Member
    Posted 3 months ago #

    Hi guys,

    Just about to give this away for the day, but here is where I am at. I stuffed around with different themes and decided I could have a crack at the DesignFolio theme and just get something working. It was all looking good, except that once again there is more than one style sheet.

    If you inspect the site-title text element you will see in my child theme I tried to make it green. Even though my child theme is first in the pecking order in the source, it is overridden by the default.css style sheet that is located at public_html/wp-content/themes/designfolio/includes/css/color_schemes

    Any ideas?

    EMG, I have not fully read your post as I have to move on to another project now, but I will respond when I am back attacking this problem again. Thankyou!

  8. EMG
    Forum Volunteer
    Posted 3 months ago #

    This link may be of some interest to you if you decide to continue with DesignFolio:

    http://wordpress.org/support/theme/designfolio

    Posting a thread there will automatically tag it for that particular theme's support.

    If you read this HERE, the theme author mentions that currently, it is not very easy to change things like colors (probably related to the scenario I mentioned in my previous post).

    Something to bear in mind in the future.

  9. mlddev
    Member
    Posted 3 months ago #

    The Designfolio theme has Back-end Options panel that allows you to set color schemes. Those overrule some of the styles in style.css.

    If you want to use a child theme to customize areas such as your site title you will need to get more specific when targeting your html and css selectors. For example, placing the following CSS in your child theme style.css file will allow you to control your site title link since it is more specific:

    /* more specific than #site-title a */
    body #site-title a {
      color: #B82D2D;
    }

    This works to override the styles set in the options panel for the theme (which are located in ../wp-content/themes/designfolio/includes/css/color_schemes/default.css

  10. xxjohnboy
    Member
    Posted 3 months ago #

    Thanks to both of you. I think I can make this theme work, as I seem to be able to override the other things besides the colour. I have also posted in the forum you mentioned EMG, where one of the developers is lurking about so hopefully I can get to the bottom of this.

    In the back of my mind, I am wondering if I should be going with some sort of very editable wordpress theme (any suggestions). I'm not too bad with CSS as I have almost finished my IT degree (not sure how as programming tends to upset me!!) so maybe it would be easier in the long run if I had more control. I'm not really sure the best route to go.

  11. EMG
    Forum Volunteer
    Posted 3 months ago #

    If you are familiar enough with HTML and CSS to build from the ground up, I might suggest some barebones themes to work from.

    Underscores, Bones (I think that's the name), Starkers are all bare themes that are very 'build your theme using this' (and not Child Theme) friendly. Hybrid also works really well. Of course, do a bit of research first to make sure the theme is meant for what you would like to do (building your own theme on top of versus styling a Child Theme).

    Generally speaking, the tendency is for comprehensive themes with lots of in-house customization done to be used as-is as opposed to being used as a Parent Theme.

    This is due to the fact that they are usually meant to be used as-is and really only modified using the already-available in-theme options (like how themes sometimes provide custom header, custom background, custom color options).

    Adding in all those extra options tends to affect the order in which things are outputted and applied in the end which can affect things like overrides.

Reply

You must log in to post.

About this Topic

Tags