You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you attempt to install a theme which is a subtheme, the install returns:
The parent theme could not be found. You will need to install the parent theme, <parent-theme-name>, before you can use this child theme.
However, it leaves behind a directory. After going to install the parent theme, re-running the command to install the subtheme then fails, with:
Destination folder already exists.
For instance:
# Attempt to install rockfield theme (not realising this is a subtheme)
wp theme install https://public-api.wordpress.com/rest/v1/themes/download/rockfield.zip --activate
# returns error "The parent theme could not be found. You will need to install the parent theme..."
# Attempt to install main theme
wp theme install https://public-api.wordpress.com/rest/v1/themes/download/varia.zip --activate
# returns success
# Now, go back to install the subtheme, rockfield:
wp theme install https://public-api.wordpress.com/rest/v1/themes/download/rockfield.zip --activate
# returns error "Destination folder already exists..."
# Workaround - firstly remove the left-behind folder, then retry the subtheme install:
rm -rf /path/to/wp-content/themes/rockfield-wpcom
wp theme install https://public-api.wordpress.com/rest/v1/themes/download/rockfield.zip --activate
If installation of a subtheme fails because the main theme is not there, the folder should not be left behind, i.e. it should be properly atomic.
The text was updated successfully, but these errors were encountered:
Hi
Other workaround is to use --force parameter - wp theme install https://public-api.wordpress.com/rest/v1/themes/download/rockfield.zip --activate --force
I'm unable to replicate the issue. WP CLI definitely throws an error when it tries to activate the newly installed child theme with no parent theme available in WordPress install.
But once you install the parent theme, child theme can be successfully activated from the back-end or the shell, there is no need to install the child theme again.
Downloading installation package from https://public-api.wordpress.com/rest/v1/themes/download/rockfield.zip...
Unpacking the package...
Installing the theme...
This theme requires a parent theme. Checking if it is installed...
The parent theme could not be found. You will need to install the parent theme, varia-wpcom, before you can use this child theme.
Theme installed successfully.
Activating 'rockfield-wpcom'...
Error: The parent theme is missing. Please install the "varia-wpcom" parent theme.
If you attempt to install a theme which is a subtheme, the install returns:
The parent theme could not be found. You will need to install the parent theme, <parent-theme-name>, before you can use this child theme.
However, it leaves behind a directory. After going to install the parent theme, re-running the command to install the subtheme then fails, with:
Destination folder already exists.
For instance:
If installation of a subtheme fails because the main theme is not there, the folder should not be left behind, i.e. it should be properly atomic.
The text was updated successfully, but these errors were encountered: