The Genesis site header usually displays at the very top of every page of your website. It usually consists of the title and tagline you have set for your website (or your logo) and sometimes a small widget area suitable for a menu, banner or search form.
With a Genesis theme, it’s easy to remove the site header altogether or just rewrite or reposition it to better suit your design. For example, many Genesis themes include a Landing Page template that removes many distracting elements, including the entire header.
The function responsible for outputting the content of the site header is
This function renders the title area markup and fires the
genesis_site_description hooks. It also fires the
genesis_header_right hook and renders the Header Right widget area if it is registered and has widgets.
genesis_do_header is hooked to
genesis_header at the default priority 10.
Remove the Site Header
Below is the basic code to remove the site header altogether.
Rewrite the Site Header
Below is the basic code to rewrite the content of the site header. Just replace
your_function_here with the name of the function that outputs your content.
Reposition the Site Header
Below is the basic code to reposition the content of the site header to another hook. Just replace
another_hook with the name of your desired hook.
Example 1: rewrite the site header to include an image.
Example 2: pop the site header out of the
<div class="site-container"> (HTML5) or
<div id="wrap"> (XHTML) markup element.
The structure of the markup produced by the function
genesis_do_header is as follows for HTML5 and XHTML themes respectively. Note that the
title-area class attribute for HTML5 themes is an ID attribute for XHTML themes, and the presence of Schema.org microdata for HTML5 themes.
Genesis Simple Hooks
If you’re a Genesis Simple Hooks user, you can find
genesis_header in the Header Hooks section and select to unhook
genesis_do_header. You can optionally add your own replacement content in the box.
There are no filters on the output of this function. However, it fires the following actions:
genesis_header_right(only fired if the Header Right widget area is registered and has widgets)
genesis_do_header has been included since version 1.0.2.
genesis_do_header is located in lib/structure/header.php.