Instantly share code, notes, and snippets.

Embed
What would you like to do?
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