register_theme_directory somehow “fails” when folder is outside of WP-Folder

This is a simple skeleton for WordPress, that makes it possible to have just “themes” and “plugins” under version control:

https://github.com/sourcerer-mike/WordPress-GIT-Skeleton

When doing register_theme_directory(__DIR__ . '/themes'); with a folder that is outside of WP, the theme is shown in the backend and can be activated.

But when viewing the front end the page stays blank.

I guess it’s up to the folder being one level above and unreachable for the client. But the server can access it, so I think I’ve done something wrong.

Is there any solution to have themes outside of WP but still working? (otherwise register_theme_directory is kind of useless)

Or is there a better solution to have those two outside?
(I also need to take care of not so experienced developer here)

My folder structure is like this:

├── plugins
├── public (document root of apache)
│   ├── wp-admin
│   ├── wp-content
│   │   ├── plugins
│   │   └── themes
│   │       ├── twentyeleven
│   │       ├── twentyten
│   │       ├── twentythirteen
│   │       └── twentytwelve
│   │       └── twentyfourteen
│   └── wp-includes
├── themes
│   └── foo
└── uploads

As soon as I change to theme “foo” the frontend stays white and empty (no single output).

1 Answer
1

While I cannot speak to your specific white-screen issue, registered theme directories must be within the Apache document root, at minimum.

Many files in themes, such as CSS, JS, images, etc, are served directly by the webserver, not via calls to WordPress. So having a theme directory that is not directly accessible and serve-able by the webserver process clearly will not work.

Leave a Comment