So if you want to show the popup on the website for first time visitors then follow this..
First of all add this code to theme footer.php file ..
Error: Contact form not found. <div id="letcont" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Contact Us for Learn More</h4>
</div>
<div class="modal-body"> <?php echo do_shortcode('
</div>
</div>
</div>
You can change the Contact form 7 shortcode to your one code.
And after that.. add this script…
<script type="text/javascript">
jQuery(document).ready(function() {
/// show div first time visitors
var isshow = sessionStorage.getItem('isshow');
if (isshow== null) {
sessionStorage.setItem('isshow', 1);
// Show popup here
setTimeout(function(){
jQuery('#letcont').modal('show');
},10000);
}
});
</script>
Here is the difference between Local and Session storage..
You can change the time to show popup too.. now i adjusted to show after 10 second.. you can change number 10000 to your one..
1 second = 1000 .. so calculate as per your need.
That’s it 🙂 .. if still need help don’t forget to comment or directly contact with us…. Thanks 🙂