I use register_theme_directory() in a mu-plugin to register a custom theme directory (located at project_root/app/views/, with site_root at project_root/public/ and WordPress in a Git submodule at project_root/public/wp/. WP_CONTENT_DIR is at project_root/public/content).

I also use Capistrano to deploy my project.

Every time I deploy, the site breaks, and I get this message in my Dashboard:

ERROR: The themes directory is either empty or doesn’t exist. Please check your installation.

When I navigate into the Appearance tab, my theme doesn't appear on the list until I refresh the page. After refreshing, I can see my theme, activate it, and everything works again.

Why might this be happening on every deploy? I am confused as to why WordPress would think the theme doesn't exist, when it definitely does.

1 Answer 1


There is a bug in class-wp-upgrader.php: WordPress is using the fixed path WP_CONTENT_DIR . '/themes' and doesn’t use get_theme_root().

I have written a patch 7 months ago … which was too late for WordPress 3.6 – the fix was delayed just today.

So use my patch, or jump in on Trac and explain why this is important.

  • Thanks for the quick reply! Too bad there's no fix other than patching core. Hopefully talking it up in Trac will get the issue taken care of. (Incidentally, I had an issue and patch delayed today as well... I think they were bug gardening today.) Jun 25, 2013 at 23:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.