Hello,
I have a modal box on my site and don't want it to show up each time a user refreshes a page.
I have placed this code on my HTML site and it works fine, however when I place it in my Wordpress blog it does not work.
I placed this code snipped after the head tag and before the body tag. I'v also tried to set the cookie in the head first but then can't figure out the logic to run the modal.
<?php
if (!isset($_COOKIE['modal'])){
setcookie("modal", "true", time()+3660, "/");
?>
<script type="text/javascript">
$(window).load(function(){
$('#modal-box').modal('show');
});
</script>
<?
}
?>
Any thoughts or suggestion would be highly appreciated.
Thanks,
Johnny