Force Login Plugin With Custom Login Page and PowerPack for Beaver Builder

How does one protect all content by restricting access to it for only logged in users and have the logged out users redirected to a custom login page built using Beaver Builder PowerPack?

1. Create a new custom login page with Beaver Builder PowerPack and insert the login module.
2. Add plugin “Force Login” which is a lightweight WordPress plugin that requires all visitors to login.
3. Edit your child theme’s function.php file to include the following:

// Force Login Plugin to Custom Login Page
function djs_login_page( $login_url, $redirect ) {
return site_url( '/slug-for-custom-login-page/?redirect_to=' . $redirect );
add_filter( 'login_url', 'djs_login_page', 10, 2 );

Be sure to replace “slug-for-custom-login-page” with the real slug for your website’s custom login page.