Il s'agit du forum d'assistance technique de WPML, le plug-in multilingue pour WordPress.

Il est accessible à tous, toutefois seuls les clients de WPML peuvent y publier leurs messages. L'équipe de WPML répond aux messages du forum 6 jours sur 7, 22 heures sur 24.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum French. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Mots-clés : 

This topic contains 4 réponses, has 2 participants.

Last updated by julienL-42 il y a 3 mois.

Assigned support staff: Noman.

Auteur Messages
juillet 17, 2019 à 1:58

julienL-42

Hello,

I would like to put the WPML flag close to the hamburger menu and not inside

Please find enclosed the goal

I have look for documentation and there are some but it is definitely to complicated to find the right place and the header.php.

I know that solution is to use below code to show custom language switcher on specific position:

do_action('wpml_add_language_selector');

but it is definitely to complicated to find the right place and the header.php.

Can you help me to make that reality on my webite ?

I use Divi theme

Regards

juillet 17, 2019 à 4:56 #4232331

Noman
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support. I have fixed this issue by doing below steps:
1. Added below code in header.php file of your child theme:

<span class="custom-mobile-switcher">
<?php do_action('wpml_add_language_selector'); ?>
</span>

2. Added below code in WPML >> Languages > Additional CSS section:

span.custom-mobile-switcher {
display:none;
}

@media(max-width:992px){
span.custom-mobile-switcher {
    display: inline-block;
    position: relative;
    top: -5px;
}
.mobile_nav .wpml-ls-item {
display:none !important;
}
}

And now it looks as in the attached screenshot. Could you please check and confirm?

Thank you

juillet 17, 2019 à 5:58 #4232801

julienL-42

Hi Noman,

This is very perfect.

But as you see this is not the original website but a clone.

Now I would like to duplicate but I cannot find where to add custom code on function.php.

Indeed, the function.php appear with nothing inside.

Can you please share me exactly which file I need to exchange on my original FTP website please ?

Should be OK for Step 2 ("2. Added below code in WPML >> Languages > Additional CSS section")

juillet 18, 2019 à 2:43 #4234399

Noman
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Sorry my mistake, please accept my apologize, I have written code in header.php file.

Please just use header.php file of your child theme.

Thank you

juillet 18, 2019 à 7:50 #4235837

julienL-42

My issue is resolved now. Thank you!