Shor hide a modal popup
I do this pretty regularly. Just create a check box such as "Show Modal", then wrap it in an if statement. If the checkbbox isn't ticked, there's no modal to display. As far as I'm aware, it doesn't matter that you still have the script trying to run it.
<?php if ($record['display_alert']): ?> <div class="modal fade" id="exampleModal"> ... </div> <?php endif ?>
Thank you. It looks like I have to wrap the statement round a class, this is the code that tells the modal to open on page load:
<body class="appear-animate js-focus-visible modal-open">
So the modal-open needs toi be disabled. Do you know how I can do that? The checkbox is called show_modal.
Here is a link to the page that the modal appears on: https://devonshirehouseschool.co.uk/SITE-DEVELOPMENT/index.php
<?php if ($pop_up_notificationRecord['show_modal'] == "1"): // checked ?>
<?php else: // not checked ?>
<?php endif ?>