Pular navegação
Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 13:00 9:00 – 13:00 9:00 – 13:00 8:00 – 12:00 8:00 – 12:00 -
- 14:00 – 17:00 14:00 – 18:00 14:00 – 18:00 13:00 – 17:00 13:00 – 17:00 -

Fuso horário do suporte: Europe/Zagreb (GMT+02:00)

Este tópico contém 0, tem 1 voz.

Última atualização: magneF-2 4 meses atrás.

Assistido por: Bruno Kos.

Autor Posts
Março 13, 2025 às 6:19 am

magneF-2

Background of the issue:
I need a popup to show only on the Norwegian site of link oculto. I have created a popup in Elementor that should be visible only on the Norwegian shop or product page. I have tried using CSS, JS, and editing the functions.php of my child theme, but nothing works. I have reached out to Elementor, and they referred me to WPML. I have added the following code in functions.php: add_action('wp_footer', 'conditionally_load_popup'); function conditionally_load_popup() { if (get_locale() === 'nb_NO') { echo '' . do_shortcode('[elementor-template id="22452"]') . ''; } } I have also added CSS in the Theme customizer: body:not(.lang-nb-no) .norway-vat-popup { display: none !important; } Additionally, I have added this code in the Elementor Custom code: document.addEventListener('DOMContentLoaded', function() { console.log('Page loaded. Current language:', document.documentElement.lang); if (document.documentElement.lang !== 'nb-NO') { console.log('Language is not Norwegian. Hiding popup.'); var popup = document.querySelector('.norway-vat-popup'); if (popup) { console.log('Popup found. Hiding it now.'); popup.style.display = 'none'; } else { console.log('Popup not found. Check the class name.'); } } else { console.log('Language is Norwegian. Popup will be shown.'); } });

Symptoms:
The popup is not showing only on the Norwegian site as intended.

Questions:
Can you help me make sure that the popup only shows on the Norwegian page?

Março 13, 2025 às 8:05 am

O tópico “[Fechado] I need a popup only to show in Norwegan site.” está fechado para novas respostas.