Comments (12)
This is a bit confusing to me. Can you share an example of what your theme is before/after? Do you mean the path in wp_options
table somewhere?
from bedrock.
It is the default Twenty Fourteen theme right now. I just switch it to another theme then back and it fixes.
Specifically it looks like the template_root option in the wp_options table is not be updated after a deploy. It is still pointing to the previous release in the releases folder.
from bedrock.
Are you using Apache or Nginx?
from bedrock.
Nginx.
from bedrock.
Interesting that this hasn't come up before. WP does some complicated stuff to do with theme and template directories. It seems like this is only triggered if you have multiple theme directories (which Bedrock does by default). I always remove https://github.com/roots/bedrock/blob/master/web/app/mu-plugins/register-theme-directory.php which means this wouldn't happen.
See here for example: https://github.com/WordPress/WordPress/blob/666fec5144eb3f7df7ee08e345a2e11db4d292ee/wp-includes/theme.php#L604-L627
This will probably take more debugging. One interim solution would be to include a WP-CLI command during the cap deploy process.
Something like:
namespace :deploy do
task :update_options do
on roles(:app) do
within fetch(:current_path) do
execute :wp, :option, :set, fetch(:release_path).join('subdir/to/themes')
end
end
end
end
after 'deploy:publishing', 'update_options'
from bedrock.
Thanks for looking into this.
I tried the wp-cli stuff but it kept telling me "Error: This does not seem to be a WordPress install." even with the yml file there or specifying the path on the command.
I can hold tight with just switching themes until a solution is found.
from bedrock.
That's because I was missing the within
block so it wasn't running in that directory to pick up the wp.yml
file. Try again with the edited code above.
from bedrock.
Thanks. I just removed the plugin file since I don't need multiple theme directories. That has me fixed for now.
from bedrock.
The solution posted by @swalkinshaw worked for me with just a minor change. The "current_path" variable is empty for some reason, so I've replaced it with "release_path". The following code works on Capistrano 3.2.1 and WordPress 4.0 when deployed to Ubuntu 14.04 + Nginx + PHP-FPM (though the deploy target shouldn't really matter):
namespace :deploy do
desc 'Update WordPress theme path to the new release'
task :update_options do
on roles(:app) do
within fetch(:release_path) do
execute :wp, :option, :set, :template_root, fetch(:release_path).join('web/wp/wp-content/themes')
end
end
end
end
Note that this requires WP-CLI installed on the server. I'll be making a pull request, since the issue is present on all of my websites. Strange that it appeared fairly recently. Maybe a recent WordPress update caused it?
from bedrock.
I was getting the white screen of death too but the fix proposed @liviucmg and @swalkinshaw didn't fix this issue for me because I noticed the stylesheet_root
wasn't being updated either. I added a new execute line to update this too.
namespace :deploy do
desc 'Update WordPress theme path to the new release'
task :update_options do
on roles(:app) do
within fetch(:release_path) do
execute :wp, :option, :set, :template_root, fetch(:release_path).join('web/wp/wp-content/themes')
execute :wp, :option, :set, :stylesheet_root, fetch(:release_path).join('web/wp/wp-content/themes')
end
end
end
end
from bedrock.
@grahamharper see my other solution here: #101 (comment)
from bedrock.
Gah, sorry, just saw that now. Cheers. At least the comment might be useful for other folks.
from bedrock.
Related Issues (20)
- Bug: Openlitespeed Wordpress pretty permalinks broken HOT 1
- Bug: htaccess not blocking /app request HOT 4
- Dependency Dashboard
- Bug: wordpress-no-content ignores wordpress-install-dir HOT 1
- Feature Request: More flexible .env.* chosing HOT 5
- Bug: Multisite not working HOT 1
- Bug: WP_ENVIRONMENT_TYPE set doesn't check if constant is already defined HOT 6
- ADD: Local environment in application.php HOT 1
- Wordpress Version in composer.json is ignored HOT 1
- Upgrading WP from 6.x to 6.3.1 stops loading core block css from wp-includes HOT 3
- There is no documentation on how to add custom blocks to a theme/plugin HOT 1
- Add file to configure production environments
- New `WP_DEVELOPMENT_MODE` constant HOT 2
- Cannot override eg. DISALLOW_FILE_MODS in .env?? HOT 3
- Redis Object Cache not working on WP_ENV='production' HOT 1
- html appended to core javascript files HOT 1
- [Feat] Keep the themes folder clean by skipping installing default themes during updates HOT 1
- [Feat] Also ignore env files not starting with `.env` HOT 2
- Add `WP_DISABLE_FATAL_ERROR_HANDLER=true` constant to development
- 404 on all perm link on frontend HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bedrock.