• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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?

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems