• David 9

    (@davidhamilton)


    Hi,

    I was wondering if you have a klean child theme available for download? I created one but my header image wasn’t imported (just the default one) and widgets seemed a little messed up. Is that normal?

    I created the style css file as follows:

    /*
    Theme Name:	klean child theme
    Description:	A klean child theme
    Template: 	klean
    Version:	1.2
    */
    
    @import url(“../klean/style.css”);

    and then the functions.php using:

    <?php
    /**
     * Enqueues child theme stylesheet, loading first the parent theme stylesheet.
     */
    function themify_custom_enqueue_child_theme_styles() {
    	wp_enqueue_style( 'parent-theme-css', get_template_directory_uri() . '/style.css' );
    }
    add_action( 'wp_enqueue_scripts', 'themify_custom_enqueue_child_theme_styles', 11 );
Viewing 4 replies - 1 through 4 (of 4 total)
  • You should delete the @import line in your child theme’s style.css: it’s redundant, as the code in your functions.php does the same thing.

    As for your header image, that sounds like normal behavior: WordPress considers the child theme to be a new theme, so you’ll likely have to reassign things like custom header images, navigation menus, and widgets, just like you did when you originally set up the parent theme.

    For your widget issue, can you post a link to a page that demonstrates the problem?

    Thread Starter David 9

    (@davidhamilton)

    Ok, I eliminated the @import line in the style.css. The widget area and header image where easy to resolve as you said by just redoing them. The one big difference I’m still noticing is the font – in the klean theme the font is ‘Source Sans Serif’ however, in the child theme it is ‘sans-serif’. On the homepage the header title only shows at 16px.

    You should be able to replicate this with a child theme. Any ideas what would cause a font change?

    Thread Starter David 9

    (@davidhamilton)

    Ok figured it out – all good now. It was my functions.php which was incorrect.
    It should have been only:

    <?php
    /**
     * Enqueues child theme stylesheet, loading first the parent theme stylesheet.
     */
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }
    Thread Starter David 9

    (@davidhamilton)

    hmmm, style sheet is actually not working with the code I posted initially.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Klean child theme available?’ is closed to new replies.