WP-Members: Membership Framework
[Plugin: WP-Members] You must be logged in to comment (5 posts)

  1. awisscorp
    Posted 5 years ago #

    When a user clicks on "logged in", it directs him to WordPress login page and not Members Area. Can I change that?

    For example,


    When a new member comes on the page and wants to comment, at the bottom it says You must be logged in to post a comment.

    When he clicks on logged in it takes him here.

    When I want it to take him to the Members Area here

    Is it possible to change that?

    Thanks for the help

  2. Chad Butler
    Plugin Author

    Posted 5 years ago #

    There is a two-fold answer to this - one for you (and others using WP 3.x themes) and those using old-school themes.

    Easy one first - for old-school type themes, this is hardcoded in your comments template. Look for comments.php in your theme folder and look for the login link. Change it accordingly.

    In WP3, a far simpler method for theme authors was introduced that does away with a lot of the if/then stuff you had to do for your comments template. This was all replaced by the function comment_form(). And, conveniently, there are some filters available for this.

    Like the above method, look in comments.php, but this time you are looking for comment_form(). Add a filter for 'must_log_in' like this:

    <?php comment_form(array('must_log_in'=>"You must be <a href='http://localhost/wp/members-area/'>logged in</a> to post a comment.")); ?>

    (Change the link and text accordingly... this is just a sample)

    Something else to consider: You can test this in your theme directly, but you might need to make a child theme (beyond the scope of this answer) so that you don't have to redo this every time you upgrade WordPress (if you use twenty ten) or your theme (if your theme author releases core upgrades).

    Hope that helps.

    (More info on the comments_form function in the codex.)

  3. awisscorp
    Posted 5 years ago #

    Many thanks!!!
    Worked perfectly!

    2 more questions though...

    1- If they clicked on logged in, then enter their details, can they be redirected to the page they were?

    2- Is it possible to have the boxes here http://7thplayer.com/members-area lined up with the text?

    Thanks again! :)

  4. awisscorp
    Posted 5 years ago #

    Anything I can do? Especially for question 2...

    Additionnally, is it possible to change the STATE entry for STATE/PROVINCE?

    Thank you!
    Your help is very appreciated.

  5. Chad Butler
    Plugin Author

    Posted 5 years ago #

    sorry for the delayed response - i've been out of town for the last week and had limited internet.

    I'm assuming the question 1 is related to if redirecting back to post if the user is directed to the members area to login/register from the comments. I would say yes that's do-able, but I don't have a specific answer to it without doing some tinkering. That makes me think its an interesting issue you've raised that I will probably look into further to add to the project list. I'd like to more tightly integrate the process.

    For #2, it looks like you might have this taken care of? There are some CSS classes for styling the form - wpmem_login and wpmem_reg. You can stylize the form elements using those classes.

    Here's a post on customized form fields:
    http://butlerblog.com/2010/09/27/adding-custom-fields-in-wp-members/. Also, the new release is going to have a toggle for this process that makes it a little easier so that you don't have to deactivate-delete to force a new field array.

    Hope that helps!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-Members: Membership Framework
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic