I’ve been working successfully on a Sage9 theme for months. However, I noticed that while it appeared in the Wordpress themes list in the backoffice, there was still a message telling that the template was missing for this theme, due to the absence of a index.php file.
wp theme list was giving me the same answer when trying to activate the (already active) theme, and Sage was not even displayed in the list.
I’ve tried to delete then create again the index.php file in /resources to see if it could fix the issue, but it made things worse. Now Wordpress has fallen back to TwentyTwentyOne and my Sage9 theme is not visible anymore in the backoffice. I’ve restored a db backup to fix. The same thing happens if I switch theme from the backoffice.
I’m not using Bedrocks and I don’t have any child theme. Any idea how I could improve this?
The error is: “Template is missing. Standalone themes need to have a index.php template file.”
There is a index.php and style.css in the /resources folder; if I click on “View details” when hovering my Sage theme, it does display the details from style.css. Theme customizer works as well.
I don’t see any error in WP or PHP log, so it’s hard to figure out what’s going wrong
Ok, it was (again) a silly thing, sorry. For some reason I had created weeks ago a style.css file in the root folder, and that seems to confuse Wordpress. I found out by creating a fresh Sage9 project, which was working fine. A quick comparison of both themes’ structure highlighted the culprit.