Support » Fixing WordPress » creating pages/posts that only registered users can see

  • I have a client who would like to start a blog with public posts as well as posts that only her registered users (clients and staff) can see. I know there is a way to password protect pages & posts, but I assume this means that they would have to enter a password for every such page or post.

    I also know that pages & posts can be saved as drafts, and then only users who are logged in w/ the appropriate user level can see them, but I suppose that means they can only see them in the admin.

    Is there a way to create pages and posts that can be seen by logging into the site, so they can be seen on the user side without having to enter a password for every one?

    Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • In 2.7.1 can’t you simply check the box for “Private Post” or “Private Page” when you create the post or page?

    And or install
    http://www.im-web-gefunden.de/wordpress-plugins/role-manager/

    Thread Starter Jonas Grumby

    (@ss_minnow)

    My understanding is that if it’s marked Private, only the author can see it. This seems like a waste of a feature to me because if I want something that only I can see, I can write it anywhere, including on a piece of paper that I can carry in my pocket. Am I misunderstanding the use of the “private” designation? In the meantime I’ll check out that plugin. Thanks.

    BTW, the ecommerce software that I use has the ability to create “availability groups” and assign registered users to these groups. Then products can also be assigned to any number of these groups so that only people in the assigned groups can see those items. This would be a further extension of the idea I’ve discussed above. In this case the client is a graphic designer and she wants to be able to post things that only her clients and staff can see. Ultimately, she’d like Client A to only see their stuff, Client B to only see their stuff, etc., and her staff to be able to see all of the clients’ stuff. Aside from that she also wants public content that everyone can see. Maybe the role manager allows this. Does anyone happen to know if it can do this?

    Thanks again.

    wescleveland

    (@wescleveland)

    I have a similar need for a friends website. I could not find anything that met his needs, so I have been working on a plugin that does what I think you are looking. We deployed the first version of the plugin yesterday. My long-term goal would be to make the plugin available for public use. It is, however, far from complete. To give you an idea how it works, I have set up some documentation at wp247.net. I will work on setting up a site to demonstrate the wp47-Membership capabilities. Check out the documentation. If, in it’s current state, it looks likes something you would be interested in trying, please let me know and we can figure out a way to make it available.

    I should warn you that, while I have been developing software professionaly for more than 30 years in a mainframe environment, I am new to php and WordPress. Having said that, I think the code is fairly solid so far. I would love to get a few testers on different sites to see if it really is as solid as I think it is. It would also be nice to know if there is any real demand for this type of plugin.

    Thread Starter Jonas Grumby

    (@ss_minnow)

    Check out the User Access Manager plugin. I have not tried it yet but it does claim to be able to create availability groups just like I was referring to.

    http://wordpress.org/extend/plugins/user-access-manager/

    I solved the problem on my other site by using the registered users only plugin to block out the public, then using Role Manager to create three levels of readership; one that can see public posts/pages, one that can see anything marked public as well as private pages, and one that can see the public stuff as well as private pages and posts. I may mess w/ the user access manager plugin though, as it would allow me to create groups associated with a given project, etc.

    John

    duncangallimore

    (@duncangallimore)

    Wes,
    Where can I download your plug-in? I would like to give it a try – it sounds a nice simple solution to the problem I’ve got at the moment.
    Many thanks,
    Duncan

    Thread Starter Jonas Grumby

    (@ss_minnow)

    Try the link above…

    Hi guys,

    I happened to stumble upon this thread because I was looking for a way to restrict the access to some pages of my wordpress site to registered users only. I found the plugin wp-sentry. So far it seems to work quite well, it even allows you to create user-groups independent of the usual wordpress roles.
    Has anyone of you tried this plugin yet?

    Have a nice weekend,
    Josef

    Thread Starter Jonas Grumby

    (@ss_minnow)

    Seems very similar to User Access Manager. Does it let you allow users by IP address (UAM does) or do they have to be subscribed?

    You can create a page template that you can apply to pages so only logged in members can view the contents:

    <?php
    /*
    Template Name: Members only page
    */
    ?>
    
    <?php get_header(); ?>
    <?php if (is_user_logged_in()) { ?>
    <div id="contents">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h2 class="title" id="post-<?php the_ID(); ?>"><?php the_title(); ?></h2>
    <?php the_content(__('Read the rest of this page &raquo;')); ?>
    <?php endwhile; endif; ?>
    </div>
    <?php comments_template(); ?>
    
    <?php } else {
    // they aren't logged in, so show them the login form
           ?>
    <div id="contents">
    <p>I'm sorry, but you must be a logged in member to view this page. Please either login below or <a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=register">Register</a> today.p>
    </div>
      <?php
    // !!! IMPORTANT !!! If you are using permalinks to rewrite the urls
    // of your site, you will need to adjust the action of the form below.
    // The form will look for the wp-login.php file based on the action.
    // If the rewritten url of your page is
    // http://www.yourdomain.com/your_page_name/,
    // you will need to change the action in the form to
    // action='../wp-login.php'
    // so it will look in the 'directory' above /your_page_name/
    // for the wp-login file.
    // Depending on your url structure, you may have to go up several directories.
    // For instance, if your page is located at
    // http://www.yourdomain.com/some_section/your_page_name/
    // you will need to change the action to
    // action='../../wp-login.php'
    ?>
    <form name='loginform' id='loginform' action='<?php bloginfo('wpurl'); ?>/wp-login.php' method='post'>
        <p>
          <label>Username<br />
          <input type='text' name='log' id='log' value='' size='20' tabindex='1' />
          </label>
        </p>
        <p>
          <label>Password<br />
          <input type='password' name='pwd' id='pwd' value='' size='20' tabindex='2' />
          </label>
        </p>
        <p>
          <label>
          <input name='rememberme' type='checkbox' id='rememberme' value='forever' tabindex='3' />
          Remember Me</label>
        </p>
        <p class='submit'>
          <input type='submit' name='submit' id='submit' value='Login &raquo;' tabindex='4' />
          <?php //use a hidden field to return them to the page they came from ?>
          <input type="hidden" name="redirect_to" value="<?php echo $_SERVER["REQUEST_URI"]; ?>" />
        </p>
      </form>
      <?php	} ?>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    to show to members only replace the if statement to something like:
    current_user_can( 'edit_posts' )

    Thread Starter Jonas Grumby

    (@ss_minnow)

    Thanks. I still plan to use the User Access Manager plugin because it allows many more options than just checking to see if the user is logged in. In fact, users can be assigned by IP address so that they don’t have to be logged in. This is much more handy for my specific purposes.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘creating pages/posts that only registered users can see’ is closed to new replies.