Skip to content

Instantly share code, notes, and snippets.

@QROkes
Last active March 6, 2016 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save QROkes/f3774314edc3f91cd33d to your computer and use it in GitHub Desktop.
Save QROkes/f3774314edc3f91cd33d to your computer and use it in GitHub Desktop.
Modify header title-url depending on the visitor browser language (Wordpress - Genesis Framework)
//* Modify header title-url depending on WP site language - HTML5 Version (Genesis Framework)
add_filter( 'genesis_seo_title', 'qr_header_title', 10, 3 );
function qr_header_title( $title, $inside, $wrap ) {
// Default
$taitol = sprintf('<span class="custom-class">QR</span> %s', get_bloginfo( 'name' ));
$inside = sprintf( '<a href="https://qrokes.com/" title="%s">%s</a>', 'Inicio', $taitol );
$currentlang = get_bloginfo('language');
// English
if($currentlang=="en-US") {
$inside = sprintf( '<a href="https://qrokes.com/en/" title="%s">%s</a>', 'Home', $taitol );
}
return sprintf( '<%1$s class="site-title">%2$s</%1$s>', $wrap, $inside );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment