ThesisAPISkinProperties$functionality → Header Image

Thesis Skin Header Image Functionality

Add Header Image functionality to any Thesis Skin with the $functionality property and the header_image parameter:

public $functionality = array(
	'header_image' => true
);

Outputting a Header Image in Your Skin

After activating Header Image functionality, you’ll need to complete two additional steps to output a Header Image in your Skin:

  1. Determine a hook location where the image will be output
  2. Reference the Skin API Header Image object to output the image

Here’s a sample hook declaration that sets up the Header Image to be output before the closing tag of an HTML Container with a Display ID of header:

add_action('hook_bottom_header', array($this, 'output_header_image'));

Usage note: This hook declaration belongs in the Skin’s construct() method.

In the above snippet, output_header_image is a method you create to output the header image HTML. You can name this method whatever you want, and all it needs to do is reference the html() method from the Skin API $header_image object, like this:

public function output_header_image() {
	$this->header_image->html();
}

And that’s it! The two simple steps illustrated above will output the header image at the hook_bottom_header location.

You may also want to filter your Skin CSS to have it behave differently if the user has selected a header image. See the Classic Responsive Skin’s skin.php file for an example of CSS filtering when a header image is present.