Skip to content

Instantly share code, notes, and snippets.

@hansswolfs
Last active January 19, 2019 10:14
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 hansswolfs/9c0da6fe2a9541ec08fbb843ca96636a to your computer and use it in GitHub Desktop.
Save hansswolfs/9c0da6fe2a9541ec08fbb843ca96636a to your computer and use it in GitHub Desktop.
WPML - Modify site description (tagline) depending on active language - Genesis Framework
//* Modify the site description depending on active language - WPML - HTML5 Version - Genesis Framework
//* This snippet only works when a Genesis theme is active
//* Useful when for example you need to add extra CSS-classes to the tagline to style it with CSS
add_action('genesis_seo_description', 'hs_custom_site_description');
function hs_custom_site_description( $tagline) {
$tagline = '<p class="site-description" itemprop="description">';
switch (ICL_LANGUAGE_CODE) {
case 'nl':
$tagline = $tagline . 'Bed & Breakfast en vakantiewoning';
break;
case 'fr':
$tagline = $tagline . 'Bed & Breakfast et maison d\'hôtes';
break;
case 'en':
$tagline = $tagline . 'Bed & Breakfast and holiday home';
break;
case 'de':
$tagline = $tagline . 'Bed & Breakfast und Ferienwohnung';
break;
default:
$tagline = $tagline . 'Bed & Breakfast en vakantiewoning';
break;
}
$tagline = $tagline . '</p>';
return $tagline;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment