• Resolved ANo.1

    (@ano1-1)


    I am trying to create a child theme and enqueue its style.css
    I followed this advise http://codex.ww.wp.xz.cn/Child_Themes
    and into child theme’s functions.php I pasted this

    <?php
        add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
        function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) );
         }

    Now it is working somehow, but not completely without problems. My question is following:
    There are more css files in the parent directory, There is the one called ‘style.css’, then there is a directory called ‘css’, containing file ‘layout.css’, and another directory ‘functions/css’ containing many different files such as ‘colorpicker.css’
    Do I need to enqueue more of them or should it be fine as I showed above?

Viewing 10 replies - 1 through 10 (of 10 total)
  • What theme are you using? Can you post a link to your site?

    Thread Starter ANo.1

    (@ano1-1)

    Mystile theme
    My site is at the moment just for me to practice with wp, so probably not helpful. http://wordpress.blanketsoftheworld.com/

    As you are using a commercial theme, I can’t say for sure whether all the appropriate stylesheets are being loaded by your child theme. You should ask your theme’s vendor for more information about that.

    If I had to guess, though, based on a look at your site, it appears like everything is working correctly. What problems are you having?

    Thread Starter ANo.1

    (@ano1-1)

    Well it is a theme by woothemes, but a free one, so there is no support for it.

    The first problem I notice is the product photos are displayed much bigger than they were on the original theme.

    thank you

    In your child theme’s stylesheet, try something like

    ul.products li.product img {
    max-width: 50%;
    }

    Experiment with the percentage until you like the look.

    Thread Starter ANo.1

    (@ano1-1)

    Sorry, I had no time. Got back to it now, and it works.
    Big Thanks!

    Thread Starter ANo.1

    (@ano1-1)

    Actually, now I found out that when I changed Theme Stylesheet from default.css to any other option, it works properly and there’s no need for the adjustment.

    Hi ANo.1,

    I’m having the same problems you were having. Larger images, my tabs are broken on the product description page, etc. I’m not understanding how you fixed it though. You said, “when I changed Theme Stylesheet from default.css to any other option, it works properly”. I have a style.css in my child theme directory. Should I change the name of that file?

    Thanks,
    Jennifer

    Ohhh, you selected a new stylesheet in the Mystile WordPress Admin, I see. And now it’s working for me as well. That is so strange. I’m so happy I found you tip. This has been bugging me for a while, and you’re right, no support on this one from WooThemes :/ Thanks again!

    Thread Starter ANo.1

    (@ano1-1)

    🙂 Cheers!

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

The topic ‘Child theme – enqueue css’ is closed to new replies.