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.

Our next available supporter will start replying to tickets in about 2.19 hours from now. Thank you for your understanding.

Etichettato: 

This topic contains 5 risposte, has 2 voci.

Last updated by Rohan Sadanandan 3 mesi, 1 settimana fa.

Assigned support staff: Rohan Sadanandan.

Autore Post
July 7, 2019 at 3:33 pm #4157869

lucam-13

We've used a code by wpml to show in the menu different things on different languages

<?php if(ICL_LANGUAGE_CODE == 'it'): ?>
<a href="hidden link" style="display:inline-block">
<div class="rolex-retailer-clock">
</div>
</a>
<script src="hidden link"></script>
<script>
var rdp = new RolexRetailerClock();
var rdpConfig = {
dealerAPIKey: 'e90c6378b8923b25d7d684406cc330ab',
lang: 'it',
colour: 'gold'
}
try {
rdp.getRetailerClock(rdpConfig);
} catch (err) {}
</script>
</div>

<?php else: ?>
<a href="hidden link" style="display:inline-block">
<div class="rolex-retailer-clock">
   </div>
</a>
<script src="hidden link"></script>
<script>
var rdp = new RolexRetailerClock();
var rdpConfig = {
dealerAPIKey: 'e90c6378b8923b25d7d684406cc330ab',
lang: 'en',
colour: 'gold'
}
try {
rdp.getRetailerClock(rdpConfig);
} catch (err) {}
</script>
<?php endif; ?>

Now, if i navigate to the en website, i see the rolex banner in italian. Is it possibile to fix this?

Let me know,
Luca

July 8, 2019 at 2:07 pm #4163305

Rohan Sadanandan
Supporter

Languages: Inglese (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

Thank you for contacting WPML Support.

Do the language codes used in the code are correct?

Could you please use this API function instead of using ICL_LANGUAGE_CODE :
https://wpml.org/wpml-hook/wpml_current_language/

Also could you please provide the debug information so that I can check this in detail?
Please go to WPML > Support > Debug Information and give me the information in the next reply. You can read the detailed instruction here: http://wpml.org/faq/provide-debug-information-faster-support/

Thanks,
Rohan

July 10, 2019 at 10:24 am #4178607

lucam-13

Hi Rohan,

The code i've used is provided by Rolex and it works since i've updated WPML to the latest version.

Can you tell me how to use the API you have mentioned in the previous message?

July 10, 2019 at 11:43 am #4179607

Rohan Sadanandan
Supporter

Languages: Inglese (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

You can replace your code:

<?php if(ICL_LANGUAGE_CODE == 'it'): ?>

with

<?php if(apply_filters( 'wpml_current_language', NULL ) == 'it'): ?>

Please let me know if you have any doubts.

Thanks,
Rohan

July 10, 2019 at 2:11 pm #4181205

lucam-13

Hi,

using this code provided by you it works. The problem now is that, when resizing the screen, the mobile menu disappear. It depends to the code used to display different language clock on different language?

July 10, 2019 at 2:39 pm #4181539

Rohan Sadanandan
Supporter

Languages: Inglese (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

Since the original issue has been resolved and for better support, we handle one issue per ticket.
As I can see you already reported this issue here: https://wpml.org/it/forums/topic/english-menu-doesnt-work-good/ so may I kindly ask you to continue on the same ticket and close this one?

Thanks,
Rohan