1

I've followed the WooCommerce instructions for child themes including declaring the child theme:

function theme_woocommerce_support() {
    add_theme_support('woocommerce');
}
add_action('after_setup_theme','theme_woocommerce_support');

(https://docs.woocommerce.com/document/template-structure/)

I created a directory in my child theme for WooCommerce template files:

\storefront-child\woocommerce\

And I've added the file I want to edit:

\storefront-child\woocommerce\templates\content-product.php

I added a comment to the file so I could have something to look for to see that it's working. The only way I can get anything to show up is to edit the original plugin files.

I've disabled all plugins other than WooCommerce to test. I've reviewed the WooCommerce status report tab, and the child theme is registered, but the child theme WooCommerce templates are not. I've made sure debug mode is disabled.

Any other ideas?

1
  • Note: this is WooCommerce version 3.4.7 with Wordpress 4.9.8. The parent theme is Storefront
    – Juxtra
    Nov 5, 2018 at 21:51

1 Answer 1

1

Perhaps this post can be helpful.

If not, then here are a couple of other things you can attempt:

Override in parent-theme
You could also (temporarily) try to override the template in the parent-theme, to see if that works.

Double-check uploaded files
I would probably also double-check the files on the remote-host, that the isn't some old file(s) messing with the setup. I don't know about you, but I sometimes just delete files locally and forget to check if they've been uploaded.

Delete template-folder from the remote host and reupload
... You could also try and delete the entire template-folder on the remote host, and then upload a single file (in case some file is cached/corrupt/whatever).

Incognito
Perhaps try in an incognito-tab (in case of cache).

Use die()
In case you try and print something and can't find it, then perhaps try and insert below-written code-snippet in your template, since that makes it obvious if the template is being executed or not.

echo '<p>Do you see me?</p>';
die();
2
  • 1
    The post you shared was helpful! So the solution was to remove the /templates/ part of \storefront-child\woocommerce\templates\ in the child theme. I don't think that makes any sense when the documentation says to follow the WooCommerce structure but that's what did it. Thanks!
    – Juxtra
    Nov 6, 2018 at 14:30
  • Remember to mark the answer. :-)
    – Zeth
    Nov 6, 2018 at 20:43

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.