• Hi Everyone,
    I’m sorry if it’s been answered before.. but, I couldn’t find it. Me and my girlfriend currently have a blog that is password protected just for us. Now, we want to switch from b2 to wordpress and want to make some posts public. However, we want members only posts as well (we are the only members). We see the password feature but it shows all those ugly this post is protected and password input boxes for each post.
    Is there a hack that allows us to change a ‘private’ post to a ‘members only’ post? So that when we login we can see all posts of each others and when logged out we can only see public posts?
    Thanks in advance,
    Wassim

Viewing 7 replies - 1 through 7 (of 7 total)
  • Sounds like you’d need something that involves a cookie. The session cookie is what allows you to access the WP interface when you log in correctly and keeps you out when the login/pass is incorrect. Theoretically you could use the cookie’s presence as an if condition for hiding/unhiding a certain category of posts (“members only”). A bit complex and beyond my scope…
    I can offer an alternative though… You could create a new category of posts and hide it from index.php, date archives, category archives, and category list. Refer to the second to last post in this thread:
    http://wordpress.org/support/5/5687
    In your case, rather than creating an About page, you’d be creating a Members Only page under a “Members” category. Then modify the mod_rewrite rule so that an esoteric URI like http://yourdomain.com/membersonlyyou'llneverguessthis12345/ would redirect to an archive of that Members category. If you ever decide to change a post from Members to public, just change the category and it should disappear from the Members page onto the front page.
    Let me know if you need help with the instructions if you decide to go with this.

    If you’re comfortable making changes to some core WordPress files, this is actually pretty easy to accomplish. I have added the ability to assign user levels to individual posts, restricting who can see that post.
    Here’s how I did it:
    I added a new row to the wp_posts table in the database called <b>post_level</b>. It is an UNSIGNED INT(2) with a default of zero.
    Then I edited the following files:
    wp-blog-header.php
    wp-admin/post.php
    wp-admin/edit-form.php
    wp-admin/edit-form-advanced.php
    wp-includes/template-functions-general.php

    You can download my version of each of these files here:
    http://www.skippy.net/wp/post_level.tgz

    Thread Starter wassimk

    (@wassimk)

    Thanks skippy! I look forward to testing this out. It sounds as if it’ll suite our purposes great!

    I’ve just downloaded WP 1.2 final, and will make the changes necessary (if any) to get this to work with the new version. Very soon I’ll make available a new “complete” download, as well as a diff and step-by-step instructions.

    Skippy, when I clicked the link above, it was a 404. Please fix it as I’m sure I’m not the only one interested in this. 🙂

    Thread Starter wassimk

    (@wassimk)

    Hey Skippy! Thanks a bunch for the work you’re doing for me and the community! I certainly appreciate it and look forward to the final result :).

    wyzewoman’s plugin looks great, and should be a terrific option for a lot of people.
    I’ve finished my modification for WordPress 1.2, and packaged it up all pretty:
    http://www.skippy.net/wordpress/index.php?p=7
    Thanks wyzewoman, for contributing another option!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘members only posts’ is closed to new replies.