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?

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.