Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Ashleigh

    (@burski)

    Please help!

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

    Hello,

    I’m using Theme 1 but the “Register” button is not displayed.

    Please advise.

    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?

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘"Login or Logout / Register" instead of Login or Logout’ is closed to new replies.