Roots Theme and WooCommerce Duplicate Header, Sidebar and Footer Fix
Roots theme makes use of the excellent Theme Wrapper which helps to cut down greatly on code clutter within your WordPress theme. WooCommerce doesn’t play nicely with this logic and you may notice duplicate headers within your code:
How to Fix the Duplicate Headers
1. Create a Blank
header.php file in your theme directory:
* Blank Header File for WooCommerce Compatibility
* @description: https://devin.org/roots-theme-and-woocommerce-duplicate-header-fix/
* @created: 3/22/13
Duplicate Sidebar and Footer with Roots and WooCommerce
Beware of duplicate sidebar and footer content. The fix is the same… simply create a blank footer.php or sidebar.php in the base theme directory.
That’s It! WooCommerce will see this header file and use it appropriately. As well, Roots will continue to use
templates/head.php across your non-woocommerce pages and posts.
Thanks to @raffjones over for providing the following solution over at this post on stack overflow: Roots Theme and Woo Commerce – duplicated header
If you know of a better solution please post in the comments below! Now go have fun with Roots and WooCommerce development.