Here are the way to show popup for first time visit and the difference between them are..
1) Localstorage – Assigned value stored after browser close.
2) SessionStorage – Assigned value removed after browser or tab close.
1) Localstorage
Localstorage value can be removed by deleting the cache of browser.
/// show div first time
var isshow = localStorage.getItem('isshow');
if (isshow== null) {
localStorage.setItem('isshow', 1);
// Show popup here
setTimeout(function(){
jQuery('#letcont').modal('show');
},5000);
}
2) SessionStorage
Assigned value removed after browser or tab close
/// show div first time
var isshow = sessionStorage.getItem('isshow');
if (isshow== null) {
sessionStorage.setItem('isshow', 1);
// Show popup here
setTimeout(function(){
jQuery('#letcont').modal('show');
},5000);
Modal or content to show
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</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.
To help contact use here.