admin管理员组

文章数量:1125763

I'm creating a theme based on Underscores. I use its 'bundle' method to generate a new zip of the theme for deploying to a dev server.

This has worked fine on other projects, but on this one each time I upload it (via Appearance / Themes in the target installation) it gets treated as a new theme, and a folder is created rather than the existing one being updated. Each new folder a number appended to its name - eg.

mytheme
mytheme-1
mytheme-2
etc

Even if I delete all the previously created folders, including the origina 'mytheme', the next upload will begin again, appending whatever the next number is due to be.

I can't figure out why this is happening, it's a new one for me?! I think permissions on the site folders are all ok - it's Ubuntu and www-data owns the whole directory structure, and uploading images, plugins etc seems to work ok.

I'm creating a theme based on Underscores. I use its 'bundle' method to generate a new zip of the theme for deploying to a dev server.

This has worked fine on other projects, but on this one each time I upload it (via Appearance / Themes in the target installation) it gets treated as a new theme, and a folder is created rather than the existing one being updated. Each new folder a number appended to its name - eg.

mytheme
mytheme-1
mytheme-2
etc

Even if I delete all the previously created folders, including the origina 'mytheme', the next upload will begin again, appending whatever the next number is due to be.

I can't figure out why this is happening, it's a new one for me?! I think permissions on the site folders are all ok - it's Ubuntu and www-data owns the whole directory structure, and uploading images, plugins etc seems to work ok.

Share Improve this question asked Apr 20, 2023 at 15:04 toby1kenobitoby1kenobi 2112 silver badges10 bronze badges 2
  • Is the zip filename just "mytheme" or contains a top-level folder named "mytheme"? If the zip contains a folder make sure that folder name is correct. Otherwise make sure you're using the correct name for the zip. – Jacob Peattie Commented Apr 20, 2023 at 16:48
  • yes, zip is mytheme.zip and includes theme files (style.css, functions.php) and no container folder – toby1kenobi Commented Apr 20, 2023 at 20:11
Add a comment  | 

1 Answer 1

Reset to default 0

Returning to this very belatedly, in case it's of any help to anyone else. It was incorrect file/folder permissions that caused this - I guess when WordPress can't overwrite the existing theme folder, it creates a new one instead.

本文标签: New directory created each time I upload new theme zip