WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Child Theme Setup Problems (15 posts)

  1. goldmember
    Member
    Posted 2 years ago #

    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.

  2. anoleimaging
    Member
    Posted 2 years ago #

    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?!?

  3. esmi
    Forum Moderator
    Posted 2 years ago #

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

  4. anoleimaging
    Member
    Posted 2 years ago #

    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...

  5. esmi
    Forum Moderator
    Posted 2 years ago #

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

  6. anoleimaging
    Member
    Posted 2 years ago #

    Yes, 2011 child works.

  7. esmi
    Forum Moderator
    Posted 2 years ago #

    Do you have the latest version of Adventure Journal?

  8. anoleimaging
    Member
    Posted 2 years ago #

    Sorry: missed the notice of this post.

    Yes, 1.7.2 is what it says.

  9. anoleimaging
    Member
    Posted 2 years ago #

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

  10. 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.

  11. anoleimaging
    Member
    Posted 2 years ago #

    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!

  12. 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.

  13. anoleimaging
    Member
    Posted 2 years ago #

    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.

  14. anoleimaging
    Member
    Posted 2 years ago #

    Works just ducky!! Thank you again. Solved!

  15. Great! Glad to help! And next time, start your own thread! :D

Topic Closed

This topic has been closed to new replies.

About this Topic