Adding custom/premium themes
After chatting with a customer who appears to be using this setup, it appears that adding custom themes is a bit of a challenge. Since the theme folder is ignored, the customer will have to either force add the theme files they include, or edit the .gitignore file. With the Drupal examples we can follow a convention to have a custom themes directory and a contrib directory. Is the same setup possible here?
@ataylorme can correct me if I'm wrong but I thought that part of the issue was that in WordPress it is not customary to have themes/contrib and themes/custom the way it is in Drupal.
Correct, only directories in the top level of wp-content/themes are detected. Something in themes/custom/premium-theme would not be detected.
I don't think editing .gitignore is a big ask since we are using the negation method. They would just need to change this line to be the directory name of their custom theme. See
Regarding premium themes, those should be installed with Composer as well and a child theme installed and committed for customizations.
See the .gitignore in my example repo
The .gitignore could be misunderstood that WordPress does allow for nested Plugins and Themes since it contains lines to include !web/wp-content/plugins/custom/ and !web/wp-content/themes/custom/
This is especially confusing to Drupal developers as using custom and contrib subfolders is considered best practice.
I suggest replacing the !web/wp-content/plugins/custom/ and !web/wp-content/themes/custom/ lines with something like:
# Uncomment the next line and the update folder name to add a custom plugin to
# the repository. Repeat as needed.
# !web/wp-content/plugins/custom_plugin_name/
and
# Uncomment the next line and the update folder name to add a custom theme to
# the repository. Repeat as needed.
# !web/wp-content/themes/custom_theme_name/
PR to follow. Please feel free to edit.