Introducing wrapper.php – A Smarter Way to Load Header and Footer Elements

Child-theme and plugin developers, it’s important to note how this change will affect your products. We’re slowly rolling out updates (started on July 18th, 2012 with JobRoller) which include a new file called wrapper.php.

It contains items previously found in header.php and footer.php which are now centralized and easier to manage from within one file.

Why the change?

Our development team came up with a more efficient way to load repetitive items such as get_header(), get_footer(), and our custom hooks. This is meant to do several things:

  • Reduce repeated calls to get_header() and get_footer()
  • Provide a cleaner overall organization of code
  • Get a much better grasp for the HTML template structure

How does this change affect me?

We have moved tags like html, head and body out of header.php and footer.php and put them in wrapper.php. Every template now automatically passes through wrapper.php.

  • Remove get_header(), get_footer() from all child theme files except wrapper.php
  • If your child theme adds code to head or body tags, some will need to be moved to wrapper.php and some will need to move to filter in functions.php

You can download the latest development version of the theme your product works with (available from your customer dashboard) and test accordingly. We strongly recommend doing this sooner rather than later so your customers get a heads up once we roll out the update.

Will regular plugins still work?

Yes. We still use the standard WordPress functions like wp_title(), wp_head(), wp_footer(), etc. The only change is where these elements now live.

Like this tutorial? Subscribe and get the latest tutorials delivered straight to your inbox or feed reader.

Your rating: none
Rating: 5 - 4 votes

Popular Add-ons

WP Email Styler

Add good looking html template to emails


(3)
$19

Ads By Category or Ad Tag

Display ads from specific category or categories by using a filter widget.


(5)
$12

Logic Widgets for Vantage

Quickly and easily add conditional content to your Vantage site including…


(4)
$29