Archived topic
Broken theme message
9 replies · Started by Matthew on July 19, 2021
I have this new message in Appearance > Themes
Broken Themes
The following themes are installed but incomplete.
Name
GeneratePress Child Theme URI: https://generatepress.com Description: Default GeneratePress child theme Author: Tom Usborne Author URI: https://tomusborne.com Template: generatepress Version: 0.1
Description
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.
The only things I did theme-related recently were
-
Copy
page.php and content-page.php from the parent theme folder into my child theme folder, andCopy/paste all my CSS from the Simple CSS plug-in into
style.css also in my child theme folderThere's also a message in admin:
GP Premium requires GeneratePress to be your active theme. Install now.
I didn't click the install link yet.
There are no front-send issues that I can tell.
thanks,
Hi there,
that means the GeneratePress (parent) theme ( downloaded from the WP repository ) is not installed.
Can you check the Theme is still listed in Appearance > Themes ?
I have GeneratePress Child Theme as Active and also GeneratePress Theme is there too, with an 'Activate' button available.
How could the parent theme not be installed as it always was, and I didn't do anything to it.
Can you try re-activating the parent theme.
Then activate the Child Theme.
That made my child theme disappear and has modified my site appearance etc. My child theme is no longer in Appearance > Themes
The problem came up after I did the things mentioned in my first post.
This is my template header for style.css (child theme) which sits in
/public_html/wp-content/themes/generatepress_child
/*
Theme Name: GeneratePress Child
Theme URI: https://generatepress.com
Description: Default GeneratePress child theme
Author: Tom Usborne
Author URI: https://tomusborne.com
Template: generatepress
Version: 0.1
*/
/*
use child theme file style.css to override GP default styles
use Additional CSS in Appearance > Customise to add new theme-specific styles
*/
This is my template header for page.php (child theme)
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package GeneratePress
*/
This is my template header for content-page.php (child theme)
/**
* The template used for displaying page content in page.php
*
* @package GeneratePress
*/
Do I need to rename the Filename for the above page.php and content-page.php?
Also as can be seen, neither of these page templates have a name i.e something like
/*
Template Name: Page
*/
In order for me to rename them for my child templates.
And what does it mean
Template is missing. Standalone themes need to have a index.php template file.
Does my child theme need to have index.php? It didn't before
Hi there,
Can you try removing the empty lines in your style.css header?:
/*
Theme Name: GeneratePress Child
Theme URI: https://generatepress.com
Description: Default GeneratePress child theme
Author: Tom Usborne
Author URI: https://tomusborne.com
Template: generatepress
Version: 0.1
*/
Let me know :)
Hi Tom,
that didn't result in any change except removal of the admittedly annoying line spacing,
thanks,
Hmm, very strange.
What happens if you back up that child theme and then delete it, then install the fresh version found here?: https://docs.generatepress.com/article/using-child-theme/
It's fixed now but it would be nice to understand what the reason was.
In my previous functions.php (now replaced) there was
function generatepress_child_enqueue_scripts() {
if ( is_rtl() ) {
wp_enqueue_style( 'generatepress-rtl', trailingslashit( get_template_directory_uri() ) . 'rtl.css' );
}
}
add_action( 'wp_enqueue_scripts', 'generatepress_child_enqueue_scripts', 100 );
Do you know if this was an original part of the child theme functions (I'm not sure if I put it there or not)
I notice it's not there anymore in the latest child theme functions file I just installed, and might be the reason for the problem I had.
It's no longer required, but having it won't cause any errors.
Not sure what the issue could have been - could have been something wrong with the stylesheet header, but that's just a guess.
Glad it's working now :)