Thesis Skin Header Image Functionality

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

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

The hook declaration belongs in the Skin’s construct() method. 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'));

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.