WP Modal Login
Open Modal Automatically (6 posts)

  1. mbenari
    Posted 3 years 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?




  2. Cole Geissinger
    Plugin Author

    Posted 3 years 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
    Posted 2 years 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
    Posted 2 years 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>');
    		// Fade in the modal window.
    		// center our modal window with the browsers.
    		var margin_left = ($(login_id).width() + 24) / 2;
    		var margin_top = ($(login_id).height() + 24) / 2;
    			'margin-left' : -margin_left,
    			'margin-top' : -margin_top
    		return false;
    // this line added to trigger the popup on page load

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

  5. emminnn
    Posted 2 years 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. :(


  6. chazy
    Posted 2 years 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


No tags yet.