WordPress.org

Ready to get started?Download WordPress

Forums

WP Modal Login
Open Modal Automatically (6 posts)

  1. mbenari
    Member
    Posted 1 year ago #

    Nice plugin..

    I want to have the modal "open" automatically when someone visits the homepage and is not logged in (or if they visit for the first time, etc...). Is this possible?

    Thanks!

    Maya

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

  2. Cole Geissinger
    Member
    Plugin Author

    Posted 1 year ago #

    I feel so bad, you have a few threads on here that I have the same response (almost). This is a do-able feature that I could probably squeeze in a closer release (probably 2.1), but I have no expected date on that at the moment as my availability is a little slim to get a good amounts of work in.

    Again, if you got the skills, you're welcome to modify the code into your own creation.

  3. caming
    Member
    Posted 10 months ago #

    Glad I found this. Not sure if it's planned in the future release, but this would be great. From a logistical point, the auto pop-up would probably need to depend on user session, etc.. That functionality seems to be the current trend on the web these days -- especially when membership conversion is so valuable.

    Awesome, awesome work on the plug-in to this point. So much value here. I hope to be able to use it sooner than later!

  4. chazy
    Member
    Posted 8 months ago #

    Found a quick and dirty way to do this.

    I load just a small part of the wp-modal-plugin along with an extra line in my global js file:

    jQuery(document).ready(function($) {
    
    	// Load the modal window
    	$('a.login-window').click(function() {
    
    		// Get the value in the href of our button.
    		var login_id = $(this).attr('href');
    
    		// Add our overlay to the body and fade it in.
    		$('body').append('<div id="overlay"></div>');
    		$('#overlay').fadeIn(300);
    
    		// Fade in the modal window.
    		$(login_id).fadeIn(300);
    
    		// center our modal window with the browsers.
    		var margin_left = ($(login_id).width() + 24) / 2;
    		var margin_top = ($(login_id).height() + 24) / 2;
    
    		$(login_id).css({
    			'margin-left' : -margin_left,
    			'margin-top' : -margin_top
    		});
    
    		return false;
    	});
    
    // this line added to trigger the popup on page load
    $('a.login-window').click();
    
    });

    Popup will only happen if the shortcode is on the current page.

  5. emminnn
    Member
    Posted 4 months ago #

    @chazy, I couldn't really implement the solution. Could you please be more specific with the instruction please?

    I did add this one line of code you sent within the wp-modal-login.js file. But the pop-up doesn't auto-happen on the page with the shortcode as it's supposed to. :(

    Thanks.

  6. chazy
    Member
    Posted 4 months ago #

    Hi emminnn,

    To be more precise, you have to create a new .js file which you will load separately. This new file will have the code content of my message above.

    Hope that's clearer!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.