Shortcode under Cookie condis
-
is it possible to execute the shortcode only under the condition that a cookie is set beforehand?
i use elementor and have tried back and forth to put it into an html or shortcode element using an if condition like this one<script> document.addEventListener('DOMContentLoaded', function() { // überprüfe hier deine Bedingung if (document.cookie.indexOf('cmplz_preferences=allow') !== -1) { // Füge den Shortcode-Inhalt in das DOM ein var shortcodeContainer = document.getElementById('mwai_chatbot_v2'); if (shortcodeContainer) { shortcodeContainer.innerHTML = [mwai_chatbot_v2]; } } }); </script>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Shortcode under Cookie condis’ is closed to new replies.