Home > Blockchain >  Should I make woocommerce template via action hooks or edit directly?
Should I make woocommerce template via action hooks or edit directly?

Time:09-05

I'm learning WooCommerce Theme development. I have a question about making template.

For example, I'm making "archive-product.php". Should I edit some HTML code to this file to design layout? Or should I use action hooks to design? Which is better?

I have copied this file to "mytheme/woocommerce" folder.

CodePudding user response:

Working with custom template files was, in my experience, more typical years ago than today, the exception being when you're radically re-designing them. Working with hooks and filters instead will generally be more flexible and maintainable across WC, WC add-on, and theme changes and updates, and, if properly organized, the functions will be easier to switch on and off during debugging, or to remove at whatever point.

  • Related