Last active
January 19, 2019 10:14
-
-
Save hansswolfs/9c0da6fe2a9541ec08fbb843ca96636a to your computer and use it in GitHub Desktop.
WPML - Modify site description (tagline) depending on active language - Genesis Framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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