Support » Themes and Templates » Child Theme Setup Problems

  • Resolved goldmember

    (@goldmember)


    on this site, I have a theme called Cearti installed. I tried to create a child theme setup and it doesnt seem to be overriding the parent theme.

    If I firebug the homepage, and click on the CSS tab, it shows the following:

    @import "http://dev.uniquerefinishing.net/wp-content/themes/Cearti/css/style.css";
    @import "http://dev.uniquerefinishing.net/wp-content/themes/Cearti/css/nivo-slider.css";
    @import "http://dev.uniquerefinishing.net/wp-content/themes/Cearti/css/orange.css";
    @import "http://dev.uniquerefinishing.net/wp-content/themes/Cearti/prettyPhoto/css/prettyPhoto.css";

    So I want to override the /Cearti/css/style.css and the /Cearti/css/orange.css files.

    So I created, and activated, a Ceartichild theme and in there I have these files:
    /themes/Ceartichild/style.css (here’s the code)
    /themes/Ceartichild/css/orange.css (here’s the code)

    Please advise why the child theme style files are not overriding the parent theme. Thanks in advance.

Viewing 14 replies - 1 through 14 (of 14 total)
  • There are numerous questions such as this (which is the one I came here to post)in this forum without answers. Does no one know why our child themes don’t show up, despite following the child theme directions to the T?

    Personally, I’m using Adventure Journal. I created a child theme and changed to that theme, but the header of my pages still shows they are linked to “…adventure-journal/style.css” and NOT “…adventure-journal-child/style.css”.

    Are there some themes that have a way of thwarting customization?!?

    esmi

    (@esmi)

    Forum Moderator

    Not intentionally, no. Have you tried creating a child of the Twenty Eleven theme?

    Haven’t really been interested in 2011, but I have successfully added a child to Modularity Lite. So I’m aware it works in some instances…

    esmi

    (@esmi)

    Forum Moderator

    The point of the exercise here is to see if you can successfully activate a child theme on that server/install.

    Yes, 2011 child works.

    esmi

    (@esmi)

    Forum Moderator

    Do you have the latest version of Adventure Journal?

    Sorry: missed the notice of this post.

    Yes, 1.7.2 is what it says.

    And thus, another thread on the same topic goes unresolved.

    Moderator Jan Dembowski

    (@jdembowski)

    Brute Squad and Volunteer Moderator

    We’re good, but definetly not mind readers or psychic. Can you provide a link via pastebin.com for your child theme’s style.css file?

    That may help us identify or at least reproduce what you are seeing.

    Edit: Or even better, the link to your actual site with the child theme if you can.

    Not to be a wise…acre about it, but that’s what questions are for. I just thought it had come up enough that *somebody* must have a solution.

    Thanks for your assistance. I’ll start with the pastebin thing, I guess, and you can tell me if it’s enough.

    I tried to follow the child theme directions & I have other sites (with other themes) that work.

    This is the child css at
    /public_html/temp_wp/wp-content/themes/adventure-journal-child

    Thanks again!

    Moderator Jan Dembowski

    (@jdembowski)

    Brute Squad and Volunteer Moderator

    Okay, the Adventure Journal theme is a little different, but that’s not insurmountable.

    The parent style.css is being loaded via wp_enqueue_style() and added to the wp_print_styles action. That overrides the normal loading of the style.css file for the child theme.

    To use the normal style.css you have to remove from the queue the parent style.css and add the child theme’s instead.

    In your adventure-journal-child directory, put in this style.css file.

    http://pastebin.com/HJ6eWbgt

    That is the same style.css file you’ve provided except I un-commented out the @import line.

    Now create a adventure-journal-child/functions.php and put in these lines.

    <?php
    // Remove the Adventure Journal parent style.css and add the child theme's style.css
    
    add_action( 'wp_print_styles' , 'mh_remove_parent_css' , 50 );
    function mh_remove_parent_css() {
            wp_dequeue_style( 'theme' );
            wp_enqueue_style( 'child-theme' , get_bloginfo( 'stylesheet_directory' ) . '/style.css' , '' , '' );
    }

    http://pastebin.com/YnFYdvdV

    That will then let the CSS work as you expect it to. Your modifications will now be applied from the child theme’s style.css file.

    Thank you! I’m going to believe you unconditionally for tonight and test in the morning.

    What you’re saying is kind of what I was suspecting: that Adventure Journal theme has some sort of coding obstacle in the way of a normal child theme work-around. I just had no idea where to start looking.

    Again, I appreciate your help and I’ll report back when I implement the above.

    Works just ducky!! Thank you again. Solved!

    Moderator Jan Dembowski

    (@jdembowski)

    Brute Squad and Volunteer Moderator

    Great! Glad to help! And next time, start your own thread! 😀

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