• Hi netbiel,

    Thank you for creating the HarmonUX theme. I really like it but I’m having a hard time getting a child theme to work properly. I can’t seem to get the style sheets to render in the correct order. When I enqueue them in functions.php, they render twice in the page source. Would you mind helping me create the correct style and function documents to get the style sheets rendering in the correct order?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m having the same issue. Any assitance on a fix?

    EDIT:

    I added a workaround until this is fixed. In the functions.php inside your child theme, you should have added the following code to load the parent theme’s style.css (accordind to Child Themes article in WP Codex):

    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );

    }

    Right below wp_enqueue_style, add another wp_enqueue_style pointing to the style.css in your child theme.

    wp_enqueue_style( 'child-style', '/wp-content/themes/harmonux-core-child/style.css' );

    (I hardcoded the URI, but there must be better ways to do this. Research for it.)

    Hello,

    I am also facing the same issue with the theme. I edit in the child theme and it is not reflecting. I cleared browser and server caches to see if that might be the issue and narrowed it down to theme. Please help.

    @kumokumo

    Can i know where to add the code above. I created a functions.php in child theme and added at the last and I get server error when I load the site.

    @amruthasrinivasan you have to add this line of code in the functions.php of the theme:

    wp_enqueue_style( 'child-style', '/wp-content/themes/harmonux-core-child/style.css' );

    Yes, I am adding the following code

    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’, ‘/wp-content/themes/harmonchild/style.css’ );

    }

    my child theme is harmonchild. I created a functions.php in child theme directory copied everything from parent theme’s functions.php and pasted your code to the very last. The previous line is add_action(‘wp_head’, ‘maxflat_site_title’, 1);

    I know zero php and i know I am making some mistake, but I don’t know what.

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