WordPress.org

Support

Support » Plugins and Hacks » WP-Members: Membership Framework » [Plugin: WP-Members] You must be logged in to comment

[Plugin: WP-Members] You must be logged in to comment

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chad Butler

    @cbutlerjr

    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.)

    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! 🙂

    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.

    Plugin Author Chad Butler

    @cbutlerjr

    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!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: WP-Members] You must be logged in to comment’ is closed to new replies.
Skip to toolbar