WordPress.org

Ready to get started?Download WordPress

Forums

WP-Members
[resolved] Login - Unable To Style Some Elements (9 posts)

  1. globaltimoto
    Member
    Posted 2 years ago #

    Hello

    Plugin is excellent !

    Just trying to tie up some small things now.

    The "Remember Me" text and checkbox appear above the LOGIN button instead of beside it. How can I style them to appear on the same horizontal?

    Thanks

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

  2. Chad Butler
    Member
    Plugin Author

    Posted 2 years ago #

    The "Remember Me" is inside of the same div as the buttons, which is styled with the .button_div class.

    This class exists for both the registration form (id #wpmem_reg) and the login form (id #wpmem_login). You only really need to worry about styling the login div for this.

    I would suggest the white-space:nowrap property. You could probably get away with just adding it for the login div, so you have:

    #wpmem_login .button_div { white-space:nowrap; }

    If you haven't already set up a custom stylesheet for the plugin, I would suggest starting with this post.

  3. globaltimoto
    Member
    Posted 2 years ago #

    Hello Chad

    Thanks for the feedback !

    Yes I have a child theme wp-members.css file and all working nicely until here.

    I'd tried white-space:nowrap; already, but didn't get the desired effect, it's weird as their is plenty of space for them to flow together.

  4. Chad Butler
    Member
    Plugin Author

    Posted 2 years ago #

    hmmm... that is odd, especially if there is enough room. A few more things to try would be:

    • see what (if any) properties might be inherited that might be throwing it off
    • try using !important on the nowrap... maybe something is overriding it
    • check the margins and padding of surrounding elements. Maybe an adjustment there might help.

    It's hard for me to say what else it might be outside of those ideas. If you have a link though, I'd take a look and see if I come up with any other ideas.

  5. globaltimoto
    Member
    Posted 2 years ago #

    Hello Chad

    Thank you again for a blindingly fast response !

    I think I have discovered the issue at hand.

    The php that generates the login page and looks wrong has this resulting source code:

    <div class="button_div">
    <input name="rememberme" type="checkbox" id="rememberme" value="forever" /> Remember me<br />
    <input type="submit" name="Submit" value="Login" class="buttons" />
    </div>

    but the login page that returns after a successful registration looks correct and has this resulting source:

    <div class="button_div">
    <input name="rememberme" type="checkbox" id="rememberme" value="forever" /> Remember me
    <input type="submit" name="Submit" value="Login" class="buttons" />
    </div>

    Notice the extra <br /> in the first example. I don't think I can combat that with css styling. Presumably something in gthe php needs to change.

    Will you be updating this perhaps ?

    Or is it something I may have accidentally introduced ?

  6. Chad Butler
    Member
    Plugin Author

    Posted 2 years ago #

    I'm not sure where that <br /> tag would be coming from, so my initial response would be that it is possible your last question is the answer - you may have accidentally introduced this - although if proven wrong, I'm willing to admit it ;-)

    There is one other possibility, which is actually what I think the problem is which I'll cover shortly.

    All of the forms are in wp-members-dialogs.php. There are two versions - legacy table based forms, and newer CSS forms. The issue at hand is with the CSS forms.

    There is only login form, and it is used anytime the login is called, and also is used for password reset and password changes. The only time the Remember Me is included is when the string is returned as a login form.

    With that in mind, it is pretty easy to track this to the source. Going to wpmem_login_form_NEW in wp-members-dialogs.php, you can see that there is no <br /> tag given. And this is the only place that this generation takes place. So it's not the code.

    I have a suspicion that this is a WP rendering issue. And here is why.

    You indicated that the break shows on a login page (which I presume you are generating with a shortcode?) but not the login dialog that is presented when you successfully register.

    I believe that the break is inserted as part of WP's parsing of the page content based on the use of the shortcode. (I would say additional verification might be attempted by comparing a registration page using the shortcode and/or members area using the shortcode to any other place the login form would show, such as on protected content where it is not generated with a shortcode.)

    There are some caveats to this theory - 1. I don't know if you made any edits to the plugin's code and 2. It doesn't do this on my testing servers. But, if this theory holds true, I don't have a workable solution at this time. As I mentioned, my testing system does not insert the break, so at this point it would be difficult to test.

    Hope that helps. Feel free to followup if you have any additional information/insight.

  7. globaltimoto
    Member
    Posted 2 years ago #

    OK Chad

    I deleted the plugin and re-installed to eliminate any possible accidents made to wp-members-dialogs.php on my part.

    No change.

    I was not clear in my description of the issue. The "parsing fault" occurs when the default login dialog results due to a page/post being blocked by the plugin. No shortcode is used in that scenario.

    On the members area page where I have used the shortcode `[wp-members page="members-area"] the "parsing fault" does NOT occur within the login dialog.

    I'm running this is xampp currently. Later today I'll have it online to test there.

  8. Chad Butler
    Member
    Plugin Author

    Posted 2 years ago #

    ahhh... now I am seeing it. Yes, my suspicion was correct - I believe that this is due to the WP rendering engine.

    Here is an outline of what is happening:

    wpmem_securify is fired to see if content should be protected; if so, contents of the_content are replaced with the login/registration form.

    WP renders the_content (this is where breaks and line breaks are paragraphed and <br />'d accordingly - this is where we are getting the line break)

    Shortcode engine fires - if there is a wp-members shortcode, then the_content is updated with appropriate forms.

    If the shortcode fires after the_content is rendered with breaks, that explains why we are seeing this on protected content pages, but not the shortcode pages. This probably didn't show up earlier because the wpmem_securify used to dump the_content and echo the forms immediately, and return empty $content. Now, with the addition to the plugin of some more advance shortcodes, it returns a string in $content, which is then run through the rendering process.

    Long story short, there's an issue and I'm going to have to work on a workaround.

    In the meantime, I would just suggest taking out the following from wpmem_login_form_NEW:

    if ( $arr[7] == 'login' ) {
    
    	$form = $form . '<input name="rememberme" type="checkbox" id="rememberme" value="forever" />&nbsp;' . __('Remember me', 'wp-members');
    
    }
  9. globaltimoto
    Member
    Posted 2 years ago #

    Thank you Chad

    I will accept the long Story short and comment out that if :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic