WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP-Members] WPMembers is asking for login in for every post? Help! (7 posts)

  1. djenkins
    Member
    Posted 4 years ago #

    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/

  2. Inspired2Write
    Member
    Posted 4 years ago #

    What version of WP are you using?
    That plugin shows it's compatible up to: 2.8.4

  3. djenkins
    Member
    Posted 4 years ago #

    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!

  4. djenkins
    Member
    Posted 4 years ago #

    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!

  5. goonk
    Member
    Posted 4 years ago #

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

  6. Chad Butler
    Member
    Posted 4 years ago #

    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!

  7. Chad Butler
    Member
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags