Force user to login or register in WordPress
Few days ago I was searching for a solution that how can I force user to login or register in a site after 5 minutes when they visit the site for the first time. Actually it was my clients requirement and to do so I was searching for many solution. But couldn’t get a real solution. I had seen a plugin that offers something like that but it has also some problem. So I tried to build it of my own. When you do like below you will be able to Force User login or register in WordPress. Just added below code in footer.php or header.php in your theme file.
After this you need to also add the below css code to your theme file or you can add it as an external css file in your theme header or footer.
Also you have to install this plugin https://wordpress.org/plugins/nice-login-register-widget/ and add this plugin widget in the widget section so that the login form shows in the popup.
The popup will look like the below
That’s it and you are done. In this way you can Force user to login or register in WordPress