-
Notifications
You must be signed in to change notification settings - Fork 41
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
Local Environment: Child theme can't be activated #33
Comments
@katinthehatsite, Do you want to take this one? |
let's do this - or at least attempt 😅 |
@katinthehatsite I'm going to pick this up so you can focus on your upcoming project. |
With some more reflection, I actually want to hold off on fixing this for now:
I'd love to hear more reports from folks who run into this in the wild, and what their scenario is. |
If it doesn't exist locally and if it's a .org theme, yes, it would be nice! |
Noting here that WordPress also fails if the parent theme is missing. If we can mirror WordPress behavior that seems sufficient. If WordPress can auto-install then that seems reasonable, but for many themes we know this is impossible because they don't exist in the registry. For those cases it seems sufficient to scope-limit this tool to not solve problems WordPress itself doesn't solve. |
I'm also not sure if we can know definitively that a given theme is a WordPress.org theme. |
3pd themes usually don't have a slug used in .org. For example
|
I agree with @dmsnell , local environment tool shouldn't solve WordPress problems that way. Activating the parent theme would be enough, assuming we use 'wp-content' mode with both themes available or we have support for paths mapping. |
## What? This pr introduces a fix when the user works in a child theme. In this case, the parent theme is not mounted and this creates a "Missing parent theme" error: ![child_theme_error](https://github.com/WordPress/playground-tools/assets/497103/a4726567-726e-4c7d-87c8-9e6ec10c864f) ## Why? This pr is the first attempt to fix that error. There is plenty of discussion about this problem [here](#33) ## How? As a first step to solve this issue, we try to find the parent theme and mount it in the appropriate folder. We assume that the parent theme is available in the parent directory, and there is some upcoming work to handle more complex scenarios ## Testing Instructions 1. Create a folder with a theme (eg: test), and a child theme (eg: test-child) 2. Run `wp-now start --path=<your-child-theme-path>` 3. Ensure there is no error in the loaded page 4. Move to `/wp-admin/themes.php` and ensure that you: - Can activate and deactivate your child theme - The parent theme is visible and can be activated and deactivated as well --------- Co-authored-by: Daniel Bachhuber <[email protected]>
* Adds eslint and an npm script npm run lint:js and npm run lint:js:fix * Adds prettier and an npm script npm run format * Adds a husky pre-commit hook to run linting and formatting * Lints and formats the files in the repository
If you run
wp-now --path=/path/to/child-theme
, the theme can't be activated because the parent theme is missing.The parent theme is missing because it isn't mounted into the filesystem.
Done is:
style.css
file for the parent them.The text was updated successfully, but these errors were encountered: