I am creating a child-theme to storefront, and for my specific purpose I want the meta information (tag, category, etc) to be available at the bottom of the page, and not right after the 'Add to cart' button.

I investigated the theme and it looked like this data is added in the hooks.php file inside /inc/structure, but when I modify it by placing my hooks.php in the child theme, nothing gets changed.

I have added the entry to init.php.. I've tried placing in all the content of the hooks.php in storefront, I've also tried using remove_action... But it's not working.

How do I change the order of inclusion of the elements using a child theme for storefront?

  • You should contact the theme author or at least post the relevant code which you are talking about, otherwise your question will just be closed as off topic – Pieter Goosen Jan 3 '16 at 15:57
  • Contact the theme author? Why can't I just ask it here? Storefront is not a small-time theme. It is the default theme of WooCommerce, and I am sure that a lot of dev have worked on it. My question is quite clear without code. – Cyril Gupta Jan 3 '16 at 18:58

Well, I didn't get an answer to this yet, but I did find it out on my own with a lot of research and some luck.

The secret is in the priority order of the hooks. The last argument which is a number. The lower the number, the higher up the item will appear. I was also able to unhook the content using 'remove_action' from one hook and add to another.

Making a child theme for Storefront (woocommerce theme) required referring to three sources. My own child theme, the storefront theme, and the woocommerce template which is a part of the woocommerce plugin.

That complicates everything a little more, but it was fun looking for things and discovering.

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.