how to set this in wp ???

Discussion in 'WordPress' started by ziva, Apr 20, 2014.

  1. #1
    hi , i have a little prbolem with wp. On my vebsite in a navigation menu bar will be 6 options as "about us " , "contact " "announcements" etc. and one of those , lets call him "for students" i want to be available just log on users , any idea how cant i reach that? and another thing is , that i want user acount create by myself and login information just give them... please any idea or recomendet theart ? thanks
     
    ziva, Apr 20, 2014 IP
  2. TIEro

    TIEro Active Member

    Messages:
    741
    Likes Received:
    177
    Best Answers:
    5
    Trophy Points:
    70
    #2
    That's functionality offered by several plugins, such as paid member areas. However, you're entering the "premium plugin" zone with your first requirement, as it's the sort of thing that, when done well, is very saleable.

    You can work around it with the (free) WP-Members plugin, which allows you to lock access to individual pages/posts. It also allows you to default to either locked or not, which is nice, as it means you can default to an open site with a locked section or a locked site with some open pages/posts.

    It'll be more work for you as admin, though it shouldn't be too hard to write a simple php function to automatically lock any post in a given category, and have that run in your header or on a schedule.

    The second part is easy: just create the users yourself and click the "Send this password to the new user by email" option. WP-Members has a tab for Emails that allows you to edit the text that gets sent out, so you can email them a useful introduction.
     
    TIEro, Apr 20, 2014 IP
  3. ziva

    ziva Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    ok thanks I appriciate it , now i have a situation here : i create a new role whitch allow "read" and "read private pages" and some new users to try.
    But when i log in with this role it show me a dasboard.... there are nothing to change just user information , but i dont want to show them dashboard but just a site .... So is there some seting whitch will redirect users after login to the site , not dashboard and profile inf ... ?
     
    ziva, Apr 22, 2014 IP
  4. carlo75

    carlo75 Active Member

    Messages:
    129
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    80
    #4
    Hi ziva,
    if I understand correctly you request, you can also try this plugin:

    http://wordpress.org/plugins/nav-menu-roles/

    Do exactly what you needs.
    Hope this help
     
    carlo75, Apr 23, 2014 IP
  5. TIEro

    TIEro Active Member

    Messages:
    741
    Likes Received:
    177
    Best Answers:
    5
    Trophy Points:
    70
    #5
    OK, so you're going the "build it yourself" route, I assume.

    You can do it with a short function in your theme, or there are plugins to do it.

    // Call function when theme/plugin initialises
    add_action( 'init', 'blockusers_init' );​

    // Block non-admin from accessing Dashboard. Redirects to homepage.
    function blockusers_init() {
    if ( is_admin() && ! current_user_can( 'administrator' ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
    wp_redirect( home_url() );
    exit;
    }​

    Note that this function stops ALL dashboard access (except for admin), so they can't access their profile or anything else - just the front end. If you want them to enter profile info or see anything in the back end, you'll have to build pages to do it.
     
    TIEro, Apr 23, 2014 IP
  6. Gadstrup Motion

    Gadstrup Motion Greenhorn

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #6
    Maybe I don't understand the dilemma but... What about using the function in posts or pages where you under the block named "Publish" can choose between "public, passwordprotected or private"?
     
    Gadstrup Motion, Apr 27, 2014 IP