-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Optimized config causes CSS URL to be prefixed with /wp
, breaking link
#226
Comments
I've seen this happen before. I think it has to do with Soil's relative URL stuff. Try disabling that module. That's not a long term solution, but I think it's a viable workaround until we come up with a proper fix. |
Thanks @QWp6t! I was hoping for a suggestion like that from someone in the know!
Sounds like that is the cause of this one, should this issue perhaps be lodged on soil's repo instead? |
Here's a workaround from @QWp6t that's been working for me: # Soil theme support
add_theme_support('soil', [
'clean-up',
'nav-walker',
'nice-search',
- 'relative-urls',
+ 'relative-urls' => php_sapi_name() !== 'cli',
]); |
I've just hit this when swapping Soil for Acorn Prettier. Acorn: 4.3 (latest)
After deploying (to staging, in my case), I ran I also tested by setting Leaving this here in the hope it's helpful for future searchers (probably me). |
Feel free to open an issue on the Prettify repo – I'm sure we can just fix this in the package. |
Terms
Description
What's wrong?
When deploying a Sage 10 website, we have enabled
wp acorn optimize
as a build-after step in our fork of Trellis.After running this command, the site tries to load the css from https://lcl.website.com/wp/app/themes/sage-dir, instead of https://lcl.website.com/app/themes/sage-dir.
What have you tried?
wp acorn optimize
and getting the same result.wp acorn optimize
command creates a config that works, but this wouldn't work with Bedrock afaik/..
to the config/assets.php URL works but it creates ugly URLs which containhttps://lcl.website.com/../wp/app/themes/sage-dir,
wp cache flush
but maybe there's another file based cache I'm not aware of?What insights have you gained?
wp acorn optimize
to work correctly but it's my understanding this will break things with Bedrock which requires /wp there. Also it works in a "live" way - if I generate the cached config and change the setting in env, it seems to use siteurl for stylesheets. If I don't cache configs, it's correctly using homeurl.Possible solutions
Temporary workarounds
wp acorn optimize
from deployments, not sure how impacting this is on performance but it seemed minimal on first glance/..
to assets.php, but this would be a last resort measure. Would almost rather just write our own script and link tags into the templates at that point.Steps To Reproduce
wp acorn optimize
to cache configs/wp/
after the public url of the siteExpected Behavior
Actual Behavior
CSS cannot load as the URLs are invalid.
Relevant Log Output
No response
Versions
Acorn 2.0.5, Trellis 1.14.0, Sage 10 beta1,2 and 10.1.6, Bud 5.3.2, WP core 5.8.4, PHP 7.4, Ubuntu 20.04
The text was updated successfully, but these errors were encountered: