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.
By default, the site header is the first element at the top of the page. However, Genesis allows you to add extra content of your choice above the site header. Popular Genesis themes have been known to add a menu bar or a widget area before the site header.
The hook to use is
Below is the basic code to add a piece of extra content before the site header. Just replace
your_function_here with the name of the function that outputs your content.
Example 1: move the primary navigation above the site header.
Example 2: add an extra widget area above the site header. Just replace
before-header with your widget area ID.
This hook fires after the opening
<div class="site-container"> (HTML5) or
<div id="wrap"> (XHTML) markup element but before the opening
<header class="site-header"> (HTML5) or
<div id="header"> (XHTML) markup element.
If your child theme supports the skip links accessibility feature, content that you hook at priority 9 or less will output before the skip links and content that you hook at priority 10 (default) or later will output after the skip links.
Genesis Simple Hooks
If you’re a Genesis Simple Hooks user, you can find
genesis_before_header in the Header Hooks section and enter your desired content into the box.
The only function hooked to
genesis_before_header by default is
genesis_skip_links. This function is hooked at the default priority 10 via lib/structure/header.php.
genesis_before_header is located in header.php.
- How to Add Extra Content to the Site Header with Genesis
- How to Insert Content After the Header or Nav with Genesis
- How to Remove, Rewrite or Move the Site Header with Genesis
- How to Add Extra Content After the Site Footer with Genesis
Relevant tutorials from the Genesis community.