WordPress.org

Ready to get started?Download WordPress

Forums

WP Modal Login
"Login or Logout / Register" instead of Login or Logout (6 posts)

  1. Ashleigh
    Member
    Posted 8 months ago #

    I would like to see both Login/Logout and Register display on all pages. How can I accomplish this? I have searched other forums and found nothing.

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

  2. Ashleigh
    Member
    Posted 8 months ago #

    Please help!

  3. Micah.Hoffmann
    Member
    Posted 8 months ago #

    +1 I have been trying to hack this to get a 'register' link. Makes a lot of sense to have a register link along with login.

  4. bigbear238
    Member
    Posted 6 months ago #

    Hello,

    I'm using Theme 1 but the "Register" button is not displayed.

    Please advise.

  5. R3v07v3R
    Member
    Posted 6 months ago #

    I have little coding knowledge, but I am trying to get this register button in my widget panel next to the login/logout button.

    I can not seem to launch the modal window with #register instead of #login-box
    even though that is the href that is used to open the register panel in the modal window it's self...

    What am I missing?

  6. osios
    Member
    Posted 2 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.]

Reply

You must log in to post.

About this Plugin

About this Topic