views:

33

answers:

2

I have 10 pages, 4 of which should be accessible by logged in users.

Is there a plugin that exists to password protect these pages? Ideally, you can login once and then subsequently view all these protected pages.

I have Googled a bit, but haven't been able to find something that lets you protect individual pages, only the entire WordPress platform.

Does something like this exist, and if there are multiple, which is the best in your experience?

Thanks

A: 

Private posts should do what you want. You shouldn't need a plugin.

BillThor
I'm still new to WordPress. How do the users sign up - can they do it from the front end? Thanks.
alex
The administrator sets the sign-up policies. This includes where users can sign up, when they get access, and what level they can get without someone adjusting their privileges. From what I have seen, the Private posts are private only from users who are no logged in. Once they login, they can read the private posts.
BillThor
+1  A: 

You could use a Membership Plugin. Most of them cost money. A Google search turned up a free one called MemberWing, but I haven't tried it and can't speak to how good it is.

Generally a membership plugin will handle registration and access control. If you decide that's overkill, you could focus just on content protection with a Custom Page Template. Below, I've attached a generic WordPress Page Template that will hide content from guests. It's based off of WordPress' old default theme. If the user is not logged in, it'll display a message telling them they can't access the content as a guest.

<?php
/*
Template Name: Protected Content
*/

get_header(); ?>

<div id="content" class="narrowcolumn" role="main">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <h2><?php the_title(); ?></h2>
        <div class="entry">
            <?php 

            if(is_user_logged_in()) {
                the_content('<p class="serif">Read the rest of this page &raquo;</p>'); 
            }
            else {
                echo "You must be logged in to access this content!";
            }

            ?>

            <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

        </div>
    </div>
    <?php endwhile; endif; ?>
<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>

<?php comments_template(); ?>

</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
Dennis Pedrie