Incomplete Theme on Deploy

Deployed my Sage 9 theme up to Fortrabbit. I’m unable to activate the theme in the admin because WP thinks the theme is incomplete for missing index.php and style.css.

  • I ran yarn build:production on my local machine.
  • I ran composer install on Fortrabbit
  • Verified that my theme got moved over to Fortrabbit (all files and directories in the stock Sage 9 except node_modules)
  • Verified same Composer version on Fortrabbit and local machine.
  • PHP 7.1.17 on Local
  • PHP 7.2.4 on Fortrabbit
  • WP 4.9.6 version on Local and Fortrabbit.
  • Ran Composer Update on Local and Fortrabbit
  • Exported/Imported my database via WP CLI Export

If you have SSH access to the server and WP CLI installed, try the following.

wp theme activate [your theme’s name]/resources

I get this error:
Error: 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 is the output of wp theme list?

And are you running Sage as a child theme? Is it the child or the parent? If it’s a child, is the parent also Sage or something different?

Running Sage 9 as a parent.

wp theme list returns:
| name | status | update | version |
| twentyfifteen | active | none | 2.0 |

Looking at the Fortrabbit database, in the options table, the theme_roots transient shows my [theme-name]/resources. Not sure if that’s helpful.

And is the child also Sage 9. Or is it something else?

This post and some of the others in the topic might give you some guidance on using Sage as a parent/child theme:

Ah! So sorry. I misunderstood. I’m running Sage 9 as its own stand-alone theme. Not as a child not as a parent. Apologies!

No problem; good to clarify.

Do you happen to be using Bedrock as well? If so, maybe share the output of wp theme path to confirm that the correct themes directory is being used (or in the options table, stylesheet_root or template_root).

Is the Twenty Fifteen theme adjacent to your Sage theme?

It isn’t using Bedrock and yes it is next to Twenty Fifteen. That’s what WP fell back to from not being able to recognize my Sage theme.

I just removed Twenty Fifteen and the theme still shows broken.

I have resolved the issue. Of course it was something silly. I went through and verified that all of the files inside /resources/ were there and sure enough index.php was missing. once I put it up there my theme was recognized by WP. Thank you for your help @knowler

1 Like