0

I'm just getting started with WordPress development and trying to understand the correct way to change small elements within a page such as Woocommerce: How to remove page title from storefront theme homepage

Is creating a child theme standard in most WordPress site implementations? Or is it more common to add a lot of code to the Additional CSS section of the Theme Customization page?

2 Answers 2

3

If you're not the author of the parent theme, then it is better to create a child theme which overwrites the changes in the parent theme.

With a child theme, you can do more than just additional CSS, you can modify template layouts and add custom functions.

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Feb 19, 2022 at 21:14
1

God was away for a long while but when he paid attention to earth again he created GIT ;)

Most themes (number out of thin air, but that is my experiance) do not understand that in order that "clients" will be able to use a child theme without worrying about future upgrades to the main theme breaking the site, the main theme has to have frozen interface which include APIs, hook usage and class usage. In practice this mostly means that any new updates are either a bug fixez or add functionality that have nothing to do with the already existing functionality of the theme. Few theme developers understand that, even fewer can manage to follow that rule.

Therefor it is not clear at all that the main advantage of child themes - being able to upgrade the main theme without breaking anythin, actually happens in real life.

If your changes are not trivial, you should concider creating a git repository, set the main theme on its own branch and have a separate branch for your production theme. When the main theme updates you can push the updates to its branch and merge them into your production branch.

If your site has many code modifications to the main theme, you might not going to bothere with that and just pick "manually" whatever security improvment there were in the main theme and ignore everything else.

This might be over your head right now if you just trying out wordpress development. In that case you might want to do it first in the "canonical" way with a child theme, but you are hopefully going to start using git if you haven't yet, and then it will take much less effort to just move to development model I described above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.