Sage: Header & Footer deprecated notice

Created on 2 Dec 2012  路  5Comments  路  Source: roots/sage

Notice: Theme without header.php is deprecated since version 3.0 with no alternative available. Please include a header.php template in your theme.

Theme without footer.php is deprecated since version 3.0 with no alternative available. Please include a footer.php template in your theme.

Believe this is replicated by doing get_header()

Most helpful comment

need more details since this doesn't happen on a default roots installation.

what plugins do you have installed? is this from woocommerce? if so: http://wcdocs.woothemes.com/codex/third-party-custom-theme-compatibility/#section-3

you just need to make a file called woocommerce.php in the theme root and put this in it:

<?php woocommerce_content(); ?>

All 5 comments

need more details since this doesn't happen on a default roots installation.

what plugins do you have installed? is this from woocommerce? if so: http://wcdocs.woothemes.com/codex/third-party-custom-theme-compatibility/#section-3

you just need to make a file called woocommerce.php in the theme root and put this in it:

<?php woocommerce_content(); ?>

If a plugin calls get_header() or similar, this notice will generate. Yes, it can be fixed by addressing each plugin, but I'd rather see a fix in Roots

what plugins are you using that are producing this problem?

In this example, WooCommerce. It loads templates with get_header('shop'); in the archive & single product templates.

Eg
https://github.com/woothemes/woocommerce/blob/master/templates/archive-product.php#L14

woocommerce doesn't include a header-shop.php file so it's only including the default header. even if that file existed, roots couldn't be made compatible to grab the desired content from it since typical header.php files contain <html>, <head>, and <body>

the method in my previous comment is the correct way to use roots and woocommerce. if you wanted different content in the header for single/archive product templates it'd only take a few lines of code in your template.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tofraser picture tofraser  路  5Comments

NickTomlin picture NickTomlin  路  6Comments

williamscotholmes picture williamscotholmes  路  4Comments

MitchEff picture MitchEff  路  3Comments

timalbert picture timalbert  路  6Comments