wpDiscuz - WordPress Comment Plugin
elementor popup log...
 
Share:
Notifications
Clear all

[Solved] elementor popup login

11 Posts
2 Users
1 Likes
542 Views
Nico39
Posts: 12
Topic starter
(@nico39)
Active Member
Joined: 9 months ago

Hi,

 

I try to link my elementor login popup window with WpDiscuz, but it needs a link, but elementor popup just provides us the possibility to open the popup with a selector like:

a[href="#link-loginpopup"]

 

Is there a way to tell WPdiscuz to open the elementor modal login window?

thank you in advance

 

Nico

10 Replies
Asti
Posts: 5473
 Asti
Support
(@asti)
Illustrious Member
Joined: 5 years ago

@nico39,

Please follow this support topic the same question is discussed here: https://wpdiscuz.com/community/troubleshooting/trying-to-add-login-url-using-a-link-pop-up-login-form/#post-3566

Nico39
Posts: 12
Topic starter
(@nico39)
Active Member
Joined: 9 months ago

thank you very much, 

With the code on the page you indicate I have the following error:

 

syntax error, unexpected '$', expecting variable (T_VARIABLE)

Nico39
Posts: 12
Topic starter
(@nico39)
Active Member
Joined: 9 months ago

Sorry have added Php snippet code, it's JS

Nico39
Posts: 12
Topic starter
(@nico39)
Active Member
Joined: 9 months ago

but nothing happen

3 Replies
Asti
 Asti
Support
(@asti)
Joined: 5 years ago

Illustrious Member
Posts: 5473

@nico39,

Have you customized the code? E.g. you should change the #jeg_loginform id in the code, etc. 

Nico39
(@nico39)
Joined: 9 months ago

Active Member
Posts: 12

@asti Yes but I think I make an error somewhere...

This is my website setting:

Capture d’écran 2022 03 11 à 15.20.31
Capture d’écran 2022 03 11 à 15.20.52
Capture d’écran 2022 03 11 à 15.20.41
Asti
 Asti
Support
(@asti)
Joined: 5 years ago

Illustrious Member
Posts: 5473

@nico39,

You should change the IDs according the ID in your case. 

image
Nico39
Posts: 12
Topic starter
(@nico39)
Active Member
Joined: 9 months ago

Ok I find a solution based on your feedback.

So you need to create an elementor Popup including login module.

 

1. Set the option "Open by a selector" by : .wpd-popup-login-form

Don't forget the dot before. This option is in your popup page by selecting the toothed wheel bottom left of the screen and selecting the "advanced" tab.

Image 12 03 2022 14 21 collée

2. After create a PHP snippet or paste the following code in your (children) theme function.php :

add_filter("wpdiscuz_login_link", function ($login) {
return str_replace(" href=", " class='wpd-popup-login-form' href=", $login);
});

 

Capture d’écran 2022 03 12 à 14.16.32

 and voilà.

Thank you very much Asti !

2 Replies
Nico39
(@nico39)
Joined: 9 months ago

Active Member
Posts: 12

Sorry forget that:

 

You have to put this JS :

 

(function($){
    $('.wpd-popup-login-form').on('click', function(e){
        e.preventDefault();
        var popuplink = $('wpd-popup-login-form"]');
        if ( popuplink.length > 0 ) {
            popuplink.each(function(i,e){
                var element = $(e);
                if ( element.attr('href') === 'wpd-popup-login-form"]' ) {
                    element.trigger('click');
                    return false;
                }
            })
        }
    });
})(jQuery);
Asti
 Asti
Support
(@asti)
Joined: 5 years ago

Illustrious Member
Posts: 5473

@nico39,

Thank you for sharing the information. We're going to mark this topic as solved and close it. 

Feel free to open a new topic if you have any other questions. 

Share: