• Resolved Pete

    (@perthmetro)


    Step 1. Add this to your functions.php

    /**
     * Bypass Force Login to allow for exceptions.
    **/
    function my_forcelogin_bypass( $bypass, $visited_url ) {
    // Allow any posts or pages with the tag 'public'
    if ( has_tag('public') ) {
    	$bypass = true;
    }
    
      return $bypass;
    }
    add_filter( 'v_forcelogin_bypass', 'my_forcelogin_bypass', 10, 2 );

    Step 2. Install this plugin OR this plugin

    Step 3. Create a tag with the name and slug public

    Step 4. Any pages or posts you would like exempt from the force login, just assign them the tag public.

    This is a user-friendly way to add/remove pages or posts instead of having to change the functions.php each time.

    • This topic was modified 3 years, 11 months ago by Pete.
    • This topic was modified 3 years, 11 months ago by Pete.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to easily make a page or post visible/excluded from the forced login’ is closed to new replies.