• No matter what I try I can’t get a simple workflow running. I am trying to secure the page of posts. I have front page pointing to a static page and posts going to another named Blog. The issues are:

    -When setting to require password – doesn’t prompt for password
    -When setting private is only hides the link from nav. I can still see the blog if I direct nav to it.
    -I have tried many plug-ins….no dice.

    The only way I have gotten the blog secure is by locking down the whole site via plug-in. It seems impossible to actually get this to work. I must be missing something simple but I can’t seem to find it. Any tips? Running 3.4.2.

    Thx!

Viewing 5 replies - 1 through 5 (of 5 total)
  • global $current_user;
    get_currentuserinfo();
    $username = $current_user->display_name;
    $user_id = $current_user->ID;
    $fn = $current_user->user_firstname;
    $ln = $current_user->user_lastname;
    //Author or above . . .
    if ($current_user->user_level >= 2){ //you can define who could access it
    
    }
    Thread Starter dmontz

    (@dmontz)

    Throw this on the index.php for page of posts? I was trying to avoid getting into the code…but oh well. I assume I could just send them to the login page if user_level fails to meet. Do you have a code snippet for that?

    Thx!

    global $current_user;
    get_currentuserinfo();
    $username = $current_user->display_name;
    $user_id = $current_user->ID;
    $fn = $current_user->user_firstname;
    $ln = $current_user->user_lastname;
    //Author or above . . .
    if ($current_user->user_level >= 2){ //you can define who could access it

    }else{
    header(‘Location: https://www.example.com/’);
    }

    global $current_user;
    get_currentuserinfo();
    $username = $current_user->display_name;
    $user_id = $current_user->ID;
    $fn = $current_user->user_firstname;
    $ln = $current_user->user_lastname;
    //Author or above . . .
    if ($current_user->user_level >= 2){ //you can define who could access it
    
    }else{
    header('Location: https://www.example.com/');
    }
    Thread Starter dmontz

    (@dmontz)

    Thanks – this would work but seems odd to me. There isn’t a plug-in that would work. With all the plug-ins that claim to be able to do this I am surprised none of them work. I can’t help but think my config is off somehow.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can't secure page of posts’ is closed to new replies.