Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by julienH-3 7 years, 5 months ago.

Assigned support staff: Denise.

Author Posts
July 16, 2014 at 8:52 am #437083

julienH-3

Hello
I use a theme (AVIAN) and I would need to change the logo image and the link of the logo depending on the language I use.

I do have until now French, french for belgium, french for switzerland, english, italian...

Can you know How I could do it?
I can only change the image (it is the same for all the language) and the link is hard codded.

<?php if (get_field('mobile_logo', 'option')) { ?>
				<div class="mobile-logo">
					<a href="<?php echo site_url(); ?>">
						<img src="<?php the_field('mobile_logo', 'option'); ?>" alt=""/>	
					</a>
				</div>
				<?php } else { ?>
				<div class="mobile-logo">
					<a href="<?php echo site_url(); ?>">
						<img src="<?php the_field('logo_image', 'option'); ?>" alt=""/>	
					</a>
				</div>
				<?php } ?>
				

thank you in advance

July 16, 2014 at 2:34 pm #437374

Denise

Hello Julien,

There are at least two possibilities:

1) If the link to the header image is set by a theme option..
Then we could "translate" the link under "WPML > String Translation"
http://wpml.org/documentation/support/troubleshooting-string-localization/

2) If the link is hard-coded, directly in the theme file. One possibility would be to utilize the wpml language constant "ICL_LANGUAGE_CODE" –
http://wpml.org/documentation/support/wpml-coding-api/

http://wpml.org/forums/topic/header-image-change-with-wpml/

Thanks,
Denise

August 1, 2014 at 6:53 am #445674

julienH-3

Tanks Denise I used solution 2