WordPress.org

Ready to get started?Download WordPress

Forums

WP Modal Login
[resolved] Enabling the register button via the Widget (7 posts)

  1. JoelStickney
    Member
    Posted 1 year ago #

    So, I'm trying to figure out why the "Register" link doesn't appear at the bottom of the widget? I've made sure not to disable it in settings and I can use the Chrome Inspector to un-hide the register box, but I can't make it show up manually?

    Does that feature just not work in the widget (I haven't tried the shortcode yet)?

    http://wordpress.org/plugins/wp-modal-login/

  2. Cole Geissinger
    Member
    Plugin Author

    Posted 1 year ago #

    The register link will only show as long as you have enabled registration in Settings > General.

    Also, make sure you update to the latest version as that fixes the issue of users being able to register when its disabled.

  3. Subtopic
    Member
    Posted 1 year ago #

    I have this setting checked, and I have the widget on the homepage, yet I do not see it? Any idea where it could be, or if I can manually place the button where I like?

  4. Subtopic
    Member
    Posted 1 year ago #

    As in I have placed the widget on the homepage in the widget menu.

  5. Cole Geissinger
    Member
    Plugin Author

    Posted 1 year ago #

    If the form fields are empty it returns empty as there is no text to display. Make sure you add in at least the login and logout text.

    If it still doesn't display, then this might be an issue with your theme and displaying the widgetized area. You can double check this by viewing the page source code and checking if there's any instance of the widget in there. (Try searching for the world wpml. There should be a class called that)

  6. Subtopic
    Member
    Posted 1 year ago #

    Could you explain where I can add in this text? Do I manually need to edit the plugin itself?

  7. osios
    Member
    Posted 10 months ago #

    Hello there, I had the same problem and I managed to find a work around.

    1) In the wp-modal-login/includes/class-wp-modal-login.php, in function modal_login_btn and line 548 change:

    $link .= '<a href="#login-box" id="loginbox1" class="login wpml-btn login-window">' . sprintf( _x( '%s', 'Login Text', 'geissinger-wpml' ), sanitize_text_field( $login_text ) ) . '</a></li>';
    to:

    $link .= '<a href="#login-box" id="loginbox1" class="login wpml-btn login-window">' . sprintf( _x( '%s', 'Login Text', 'geissinger-wpml' ), sanitize_text_field( $login_text ) ) . '</a></li>';

    2) In file wp-modal-login/js/wp-modal-login.js make the following changes (WP uses minified version, so change to that first):

    a) After Line 7 add: login_id = '#login-box';

    b) In Line 38 add:

    $('#loginbox1').click(function(e) {
    		// Remove any messages that currently exist.
    		$('.wpml-content > p.message').remove();
    
    		// Get the link set in the href attribute for the currently clicked element.
    		var form_field = '#login';
    
    		//alert(form_field);
    		$('.wpml-content').hide();
    		$('.section-container ' + form_field).fadeIn('fast');
    
    		e.preventDefault();
    
    		if(form_field === '#register') {
    			$(this).parent().fadeOut().removeClass().addClass('hide-login');
    		} else {
    			$('a[href="#login"]').parent().removeClass().addClass('inline').fadeOut();
    		}
    	});

    3) Then you can add to header.php or in any other template php this piece of code:

    <a href="#register">Register</a>

    This should do the job.

    Happy Coding Everybody!

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.