Support › Forums › Support (Legacy) › WPML change logo code missing from documentation
-
AuthorPosts
-
12/04/2016 at 9:01 #1358
Hi,
First of all great job guys on an amazing theme – I’m like a kid in a sweet shop!
One thing: I’m building a multilingual site and using a child theme to change things; in the comprehensive documentation on this site, there is a page on how to do it, but it is missing the code snippet required for the child theme. Could you paste it here and/or update the page please?! I need it urgently!
WPML: How to Change the Logo in the Theme for every Language
Thanks,
Arthur12/04/2016 at 9:35 #1360Hi Arthur,
This is the code:
function pojo_wpml_get_multilang_logo( $value ) {
if ( defined( ‘ICL_LANGUAGE_CODE’ ) ) {
$logos = array(
‘en’ => ‘logo-en.png’,
‘he’ => ‘logo-he.png’,
);
$default_logo = $logos[‘en’];
$current_lang = ICL_LANGUAGE_CODE;
$assets_url = get_stylesheet_directory_uri() . ‘/assets/images/’;if ( isset( $logos[ $current_lang ] ) )
$value = $assets_url . $logos[ $current_lang ];
else
$value = $assets_url . $default_logo;
}
return $value;
}
add_filter( ‘theme_mod_image_logo’, ‘pojo_wpml_get_multilang_logo’ );12/04/2016 at 10:48 #1361You can also refresh the documentation, we’ve added the code.
12/04/2016 at 11:00 #1362Hi Boaz,
Thanks for that. So all I need to do is add the different icons to the /assets/images folder, right?
Is there a repository of language files anywhere to avoid having to translate all the strings? One of the languages I need is Spanish, so I assume someone must have done this one before! It’s not a big deal as there aren’t that many strings that will be visible to the visitor and most clients understand a minimum of English (since the ones that want languages want English as an option!), but it would save time, which is limited.
Thanks,
Arthur12/04/2016 at 11:21 #1363Hi Noa – clearly I hadn’t read your reply before posting (didn’t refresh the page!) You can mark this as closed/resolved 🙂
Thanks and I hope others will benefit from this little intervention 🙂
Arthur
-
AuthorPosts
The forum ‘Support (Legacy)’ is closed to new topics and replies.