This question already has an answer here:
I am trying to fire up a modal that I've created with a plugin (Popup Builder). I have to admit that I dpnt know a lot of JS, so I've just been googling and tried different possible solutions. None, however, seem to work. The latest I've tried throws a * Parse error: syntax error, unexpected '<' in /nas/content/live/test/wp-content/themes/new-theme/functions.php on line 1073*. Underneath you see the code thats throwing the error. How do I accomplish the modal to appear in this statement with JS?
function check_cookies() {
// Check if cookie is already set
if(isset($_COOKIE['tln'])) {
} else {
<script>
$(window).on('load',function(){
$("").sg-popup-id-163('show');
//if you want you can have a timeout to hide the window after x seconds
});
</script>
}
}
add_action('init', 'check_cookies');
Aucun commentaire:
Enregistrer un commentaire