Tagged: x
-
AuthorPosts
-
June 1, 2016 at 2:45 am #1019549
svdgParticipantHi, I use WPML and I want to display a different logo for each language. There are 2 languages: nl and en. Each logo has to have it’s own URL as well. I have found some examples but they all break the code, so please help. I use the Renew theme, but I don’t care to change it in global. I already have a child theme.
June 1, 2016 at 2:55 am #1019553
DarshanaModeratorHi there,
Thanks for writing in! Please refer to the following thread (https://community.theme.co/forums/topic/wpml-logo-change/).
If you have any issues, share your code here using the code tags in the forum toolbar (you can wrap your code within the code tags), so that we can assist you accordingly.
Thanks!
June 2, 2016 at 4:18 am #1021780
svdgParticipantThis reply has been marked as private.June 2, 2016 at 7:05 am #1021979
Paul RModeratorHi,
Please replace your code with this.
<?php // ============================================================================= // VIEWS/GLOBAL/_BRAND.PHP // ----------------------------------------------------------------------------- // Outputs the brand. // ============================================================================= $site_name = get_bloginfo( 'name' ); $site_description = get_bloginfo( 'description' ); //$logo = x_make_protocol_relative( x_get_option( 'x_logo' ) ); if (wpml_getLanguage() == 'nl'): $logo = 'http://www.moveformotion.nl/img/logo.png'; elseif (wpml_getLanguage() == 'en'): $logo = 'http://www.moveformotion.nl/img/logo.png-en'; endif; $site_logo = '<img src="' . $logo . '" alt="' . $site_description . '">'; ?> <?php echo ( is_front_page() ) ? '<h1 class="visually-hidden">' . $site_name . '</h1>' : ''; ?> <?php if(wpml_getLanguage()=='nl'): ?> <img src="http://www.moveformotion.nl/img/logo.png" alt="Praktijk voor psychotherapie" border="0"/> <?php elseif(wpml_getLanguage()=='en'): ?> <img src="http://www.moveformotion.nl/img/logo-en.png" alt="Psychotherapy practice" border="0"/> <?php endif; ?>Hope that helps
June 2, 2016 at 10:33 am #1022382
svdgParticipantThis reply has been marked as private.June 2, 2016 at 1:04 pm #1022673
Nabeel AModeratorHi there,
Can you please also provide the URL of your site so we can take a look?
Thanks!
June 2, 2016 at 1:09 pm #1022686
svdgParticipantThis reply has been marked as private.June 2, 2016 at 7:49 pm #1023308
Rue NelModeratorHello There,
I am another staff checking on this thread! I went ahead and modified the code above. I ended up using this:
<?php // ============================================================================= // VIEWS/GLOBAL/_BRAND.PHP // ----------------------------------------------------------------------------- // Outputs the brand. // ============================================================================= $site_name = get_bloginfo( 'name' ); $site_description = get_bloginfo( 'description' ); $logo = x_make_protocol_relative( x_get_option( 'x_logo' ) ); if ( ICL_LANGUAGE_CODE == 'nl' ): $logo = '//www.moveformotion.nl/wp-content/uploads/2015/02/logo.png'; $site_description = 'Dutch description here'; elseif ( ICL_LANGUAGE_CODE == 'en' ): $logo = '//www.moveformotion.nl/wp-content/uploads/2015/02/logo.png'; $site_description = 'English description here'; endif; $site_logo = '<img src="' . $logo . '" alt="' . $site_description . '">'; ?> <?php echo ( is_front_page() ) ? '<h1 class="visually-hidden">' . $site_name . '</h1>' : ''; ?> <a href="<?php echo home_url( '/' ); ?>" class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>"> <?php echo ( $logo == '' ) ? $site_name : $site_logo; ?> </a>Please edit it again and supply the correct image path for the Dutch and English version of your logo. I also want to edit the description for both languages.
Please let us know how it goes.
June 3, 2016 at 9:43 am #1024283
svdgParticipantThat works, thanks!
June 3, 2016 at 3:10 pm #1024697
JoaoModeratorGreat to hear it.
Let us know if you need help with anything else.
Thanks
Joao
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1019549 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
