Add Button To Genesis Header Right Hook

This basic tip enables you to remove the header right widget area and hook in a clickable button.

Simply add the following PHP code to the end of your child themes functions.php file.

unregister_sidebar( 'header-right' );

add_action( 'genesis_header_right', 'hook_header_right' );
function hook_header_right() {
echo'<a class="button" href="http://example.com">Click Button</a>';
}

Swap out the genesis_header_right hook with any other genesis hook.

Based on this question from a member of the StudioPress community:

Enterprise Pro theme – Header Right widget area : We want to add a “donate” button in the upper right of the header area. However, when I added the text widget, it increases the height of the header area creating more empty space below the header image — instead of aligning with the header so it is balanced. I’ve tried coding it different ways, but am at a loss. Any ideas?

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.