I use to work a basic theme with a child-theme. The parent theme contains the woocommerce.php template, which I would like to disable in the child theme. I already used several codes in the child theme's functions.php, but none worked. Can anyone imagine how I can neutralize this template? Thanks in advance!

  • What do you mean "neutralize"? – Jacob Peattie Nov 17 '18 at 6:23
  • Not clear your requirement. – vikrant zilpe Nov 17 '18 at 7:02
  • Sorry guys, I meant disable that parent theme php template in the child-theme, but without overwriting it with another template. – Rodrigo Grigoletti Nov 20 '18 at 13:43

I'm assuming that with 'neutralize' you mean de-register or remove, such that WC doesn't see (or recognize) the file and functions as it would have without the woocommerce.php-file being there.

This answer proposes a code in which your child theme (by code) physically deletes the parent theme file. There's also a questions here that seems related to your problem.

  • Hi Bram, thanks for the reply. Exactly, I want to disable this parent theme template in the child theme. I already tried this and other codes that I found here, but I did not succeed. Any other sugestion? – Rodrigo Grigoletti Nov 20 '18 at 13:40
  • Any errors on running the first code? I cannot really think of a way why hard-deleting it from the parent theme folder wouldn't work. Have you tried de- and re-activating the (child) theme after making these changes? – Bram Nov 21 '18 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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