Please note that the information in this post may no longer be accurate or up to date. I recommend checking more recent posts or official documentation for the most current information on this topic. This post has not been updated and is being kept for archival purposes.

roots-theme

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:

Roots Theme Duplicate Headers

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
 */

add-blank-header-to-roots

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.

Similar Posts