0
votes

Im trying to create a child theme in wordpress but im getting this error

Broken Themes

The following themes are installed but incomplete.

Name Description
Rife child Template is missing. Standalone themes need to have a index.php template file. Child themes need to have a Template header in the style.css stylesheet.

What am i doing wrong?

Here is the files
Style.css

/*
Theme Name: Rife child
Description: Made by <a href="http://apollo13themes.com/" target="_blank">Apollo13</a>.<br/> Get support from <a href="http://support.apollo13.eu/" target="_blank">Forum</a>.
Author: Apollo13
Author URI: https://apollo13themes.com/
Theme URI: https://apollo13themes.com/themes
License: GNU General Public License version 3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Tags: theme-options, post-formats, two-columns, translation-ready
Text Domain: rife
Version: 1.0
*/

Functions.php

<?php

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

}
?>
1

1 Answers

0
votes

Actually, there's only two files required in child theme: the style.css and the functions.php.

I simply think that your style.css is missing the header. Here's an example of the mandatory header of a child theme.

/*
 Theme Name: My Child Theme
 Theme URI: https://www.example.com/themes
 Description: My Child Theme
 Author: John Deo
 Author URI: https://www.example.com/
 Template: parent_theme_name
 Version: 1.0
 Text Domain: my-child-theme
*/

Also, you need to enqueue the parent style sheet by including this in your child theme function.php:

<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );

}
?>