Saltar navegación
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 -

Zona horaria del soporte: Europe/Zagreb (GMT+02:00)

Este tema contiene 0 respuesta, tiene 1 voz.

Última actualización por magneF-2 hace 3 meses, 2 semanas.

Asistido por: Bruno Kos.

Autor Publicaciones
marzo 13, 2025 a las 6:19 am

magneF-2

Background of the issue:
I need a popup to show only on the Norwegian site of enlace 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?

marzo 13, 2025 a las 8:05 am

El tema “[Cerrado] I need a popup only to show in Norwegan site.” está cerrado a nuevas respuestas.