1. Home
  2. ReHub Theme
  3. How to …
  4. How to trigger login popup on page loading for guests

How to trigger login popup on page loading for guests

If you want to show login popup for guests (this can be useful if you want to restrict access to site for non logged users), you must do next steps

  1. Enable Login popup in theme option – user option and don’t forget to enable Registration on Settings – general
  2. Use next code in Theme option – General – JS code for footer
<script>
jQuery(document).ready(function($) {
if (!$('body').hasClass("logged-in")) {
         $.pgwModal({
            titleBar: false,
            target: '#rehub-login-popup',
            mainClassName : 'pgwModal re-user-popup-wrap',
         });
         $('.re-user-popup-wrap .rehub-errors').html('');
}
});
</script>