Support » Fixing WordPress » [Plugin: WP-Members] WPMembers is asking for login in for every post? Help!

  • I’ve had WP-Members up and running on a developing site for a week or so, and it was working wonderfully. I have a page with the slug “members-area” where a user logs in and is then able to see several other pages.

    Now, if I’m not logged in, every single post displays the WP-Members login, and I can’t view the posts without logging in. These posts should be readable by everyone, logged in or not.

    If anyone has any ideas, please let me know! THANKS!

    http://wordpress.org/extend/plugins/wp-members/

Viewing 6 replies - 1 through 6 (of 6 total)
  • What version of WP are you using?
    That plugin shows it’s compatible up to: 2.8.4

    I’m using 2.9.1. My question stems from the fact that it was working fine, and now it’s not. There’s a chance that the client went in and tweaked some stuff related to roles/categories, but I can’t be sure (the say no. Not sure if I believe them.)

    Any ideas?

    It’s driving me crazy!

    Just wanted to update this thread to say I’ve fixed the problem.

    I just dove in and edited the plugin so blocking posts is not even an option.

    YAY WORDPRESS!

    Would also like to unblock posts by default. What bits did you edit?

    The plugin blocks all posts by default and leaves pages unblocked.

    With a little tweaking, this can be changed (as djenkins mentioned). The function wpmem_securify is where the plugin determines whether to block or not. There are basically three possibilities:

    1. it’s a post (is_single)
    2. it’s a page but not members-area (is_page() && !is_page(‘members-area’))
    3. it’s the members-area page (is_page(‘members-area’))

    This function as it is written goes through a series of conditions to determine whether or not to block the post. For the first two points above, one of those conditional statements looks for a custom field as follows:

    • Posts: (!get_post_custom_values(‘unblock’))
    • Pages: (get_post_custom_values(‘block’))

    Making a slight tweak to these changes the defaults. If, as you mentioned, you wanted posts to be unblocked by default but wanted to leave open the possibility to block at your will, then change the condition of posts from:

    (!get_post_custom_values(‘unblock’))

    to be:

    (get_post_custom_values(‘block’))

    Now posts will be unblocked, but if you wanted a specific post to be blocked, you would set a custom field of “block” to a value of true (or 1, either should work) for that post.

    Hope that helps!

    Note that in the new version of WP-Members (2.2), blocking/unblocking posts by default can be toggled in the admin panel. If you made code changes AND you are upgrading, you should make sure that you update this setting in the admin panel.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: WP-Members] WPMembers is asking for login in for every post? Help!’ is closed to new replies.