1
votes

I'm using a child theme with HTML5 Blank as the parent theme. I've used this before without any issue but for some reason I'm now getting the following error on my themes page -

Broken Themes The following themes are installed but incomplete. Name Description
HTML5 Blank Child Theme The parent theme is missing. Please install the "html5blank" parent theme.

This is what I have in my folder -

style.css

/*
 Theme Name:   HTML5 Blank Child Theme
 Description:  A child theme of the HTML5 Blank WordPress theme
 Author:       Mike Whitehead
 Template:     html5blank
 Version:      1.0.0
*/

I've tried numerous different variations on this - also copying the official wordpress guide. The above wording worked for me on my last project so don't know why it won't work now.

This is my functions file -

functions.php

<?php
function my_theme_enqueue_styles() {

    $parent_style = 'html5blank-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style ),
        wp_get_theme()->get('Version')
    );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
?>

Not sure why this isn't working. Any assistance would be appreciated.

2
What is the name of the parent and child theme directories? It could be an issue with the naming convention.Dedering
does you parent theme has this folder name : html5blankA Shah
@Dedering The directory name for the parent is html5blank-stable does this change things?Mike.Whitehead
@AkshayShah See answer aboveMike.Whitehead
Please see my answer. The child themes 'Template' tag should match the folder name of the parent theme.Mat

2 Answers

1
votes

The child themes style.css 'Template' tag should match that of the parent themes folder name eg.

/*
 Theme Name:   HTML5 Blank Child Theme
 Description:  A child theme of the HTML5 Blank WordPress theme
 Author:       Mike Whitehead
 Template:     html5blank-stable
 Version:      1.0.0
*/

As per the WordPress Codex page on Child Themes - https://codex.wordpress.org/Child_Themes

"The Template line corresponds to the directory name of the parent theme. The parent theme in our example is the Twenty Fifteen theme, so the Template will be twentyfifteen. You may be working with a different theme, so adjust accordingly."

-2
votes

Get Your Parent Theme's Textdomain and put it as child theme's Template name. Let's say your Parent theme's Style.css header like this...

/*
 Theme Name:   HTML5 Parent Theme
 Description:  A HTML5 Blank Parent WordPress theme
 Author:       Mike Whitehead
 Text domain: html5blank
 Version:      1.0.0
*/

Then you can use this Text domain name into your child theme like this..

/*
 Theme Name:   HTML5 Blank Child Theme
 Description:  A child theme of the HTML5 Blank WordPress theme
 Author:       Mike Whitehead
 Template:     html5blank
 Version:      1.0.0
*/