Hi,
I want my website to display a logo for each language. I am using WPML plugin. In my child theme I changed parts/mastead.php. It works for the French version, but not for the English. I am not a PHP expert. Could you help me? Thank you.
<?php /** * Part Name: Default Masthead */ ?> <header id="masthead" class="site-header" role="banner"> <div class="hgroup full-container"> <?php if(ICL_LANGUAGE_CODE=='fr'): ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home" class="logo"><?php vantage_display_logo(); ?></a> <?php elseif(ICL_LANGUAGE_CODE=='en'): ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home" class="logo"><img src="images/logo-en.png" alt="Jedi Project"></a> <?php endif;?> <?php if( is_active_sidebar('sidebar-header') ) : ?> <div id="header-sidebar"> <?php // Display the header area sidebar, and tell mobile navigation that we can use menus in here add_filter('siteorigin_mobilenav_is_valid', '__return_true'); dynamic_sidebar( 'sidebar-header' ); remove_filter('siteorigin_mobilenav_is_valid', '__return_true'); ?> </div> <div><?php echo ICL_LANGUAGE_CODE; ?> </div> <?php else : ?> <?php endif; ?> </div><!-- .hgroup.full-container --> <?php get_template_part( 'parts/menu', apply_filters( 'vantage_menu_type', siteorigin_setting( 'layout_menu' ) ) ); ?> </header><!-- #masthead .site-header -->
Hi Flojo
Please try making your second logo url an absolute path. Right now it reads:
Please try changing that to your full domain path.
If that doesn’t help, please send through a zipped copy of your child theme to [email protected] and I’ll take a look. If you email, please include a link back to this thread so we can reference it.
Thanks
Thank you very much Andrew. It works! I’ll remember in the future to always use absolute URL’s.
If somebody wants to reuse my snippet, here it is corrected (I had left an echo line form an earlier test).
Perfect :-)
Thanks for sharing with other too
Always feel free to open a new thread whenever you require support
Cheers
Awesome Flojo, glad we found the problem :) All the best.