Skip to content

Instantly share code, notes, and snippets.

@JiveDig
Created May 10, 2013 18:11
Show Gist options
  • Save JiveDig/5556270 to your computer and use it in GitHub Desktop.
Save JiveDig/5556270 to your computer and use it in GitHub Desktop.
Add phone number with click to call to header right hook in Genesis.
// Add phone number above nav, also add mobile menu
add_action( 'genesis_header_right', 'vp_call_us' );
function vp_call_us() {
if(strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'mobile') || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'android')) {
echo '<div class="vp-call-us"><a href="tel:908-852-7028">Click to call! (908) 852-7028</a></div>';
} else {
echo '<div class="vp-call-us">(908) 852-7028</div>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment