This modal code gated our wordpress resource pages just fine until it just stopped working. What could be the problem why they just don't work anymore

49 views Asked by At

This code has worked just fine on our wordpress pages, but it just stopped working. Its just a modal window that displays a form in a frame from Pardot, and the thank you redirect points to access=yes which allows the user to see the page without the modal. It was a handy little script to capture emails for resources but has completely stopped working. Ideas what could be the problem?

<!-- Magnific Popup core CSS file -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.min.css">
<!-- Load jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<!-- Magnific Popup core JS file -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js"></script>


<script type="text/javascript">
$(document).ready(function() {
// Parse the URL
function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
    return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
// Give the URL parameters variable names
var access = getParameterByName('access');
// if access does not = yes then display the popup
if (access != 'yes') {
$.magnificPopup.open({
  items: {
    src: 'https://www2.riskonnect.com/l/29712/2023-01-06/9nhcnv'
  },
  type: 'iframe', modal: true
});
}
});
</script>


Popup no longer works, so the pages are no longer gated.

0

There are 0 answers