The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Trying to add Login...
 
Notifications
Clear all

Trying to add Login URL using a # link (pop up login form)

7 Posts
2 Users
0 Reactions
7,081 Views
(@ajoyshop)
Posts: 5
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
[#706]
 
We found this on the theme developers site: 
 
(function($){
$('.wpd-login').on('click', function(){
var popuplink = $('a.jeg_popuplink');
if ( popuplink.length > 0 ) {
popuplink.each(function(i,e){
var element = $(e);
if ( element.attr('href') === '#jeg_loginform' ) {
element.trigger('click');
return false;
}
})
}
});
})(jQuery)
 
It allows us to make a button clickable, so I added your button's class name. It does open the button but within seconds it redirects to the homepage because we have to put in the whole URL.
 
Please advice.
 

This is the URL for our login form: #jeg_loginform


 
Posted : 16/08/2020 11:13 pm
Asti
 Asti
(@asti)
Posts: 8257
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Hi @ajoyshop,

Use this one:

(function($){
$('.wpd-login').on('click', function(e){
e.preventDefault();
var popuplink = $('a.jeg_popuplink');
if ( popuplink.length > 0 ) {
popuplink.each(function(i,e){
var element = $(e);
if ( element.attr('href') === '#jeg_loginform' ) {
element.trigger('click');
return false;
}
})
}
});
})(jQuery)

The red marked part was added. 


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 17/08/2020 1:16 pm
(@ajoyshop)
Posts: 5
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Thank you so much! It works.


 
Posted : 17/08/2020 6:28 pm
(@ajoyshop)
Posts: 5
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

I did notice now that when you click to "log out" above WPdiscuz that the login pop up still comes up. I guess it's calling that class no matter what. Any way to fix that?


 
Posted : 17/08/2020 6:45 pm
Asti
 Asti
(@asti)
Posts: 8257
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@ajoyshop,

Please remove the code provided in the previous post and use this one:

(function($){
$('.wpd-popup-login-form').on('click', function(e){
e.preventDefault();
var popuplink = $('a.jeg_popuplink');
if ( popuplink.length > 0 ) {
popuplink.each(function(i,e){
var element = $(e);
if ( element.attr('href') === '#jeg_loginform' ) {
element.trigger('click');
return false;
}
})
}
});
})(jQuery);

I did notice now that when you click to "log out" above WPdiscuz that the login pop up still comes up. I guess it's calling that class no matter what. Any way to fix that?

Use this code: 

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

In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 18/08/2020 12:38 pm
(@ajoyshop)
Posts: 5
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Now when I click login it doesn't even pop up, it just redirects to the homepage. 


 
Posted : 18/08/2020 4:42 pm
(@ajoyshop)
Posts: 5
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

When I re-added the old top code it works again but the add_filter doesn't seem to be doing anything.


 
Posted : 18/08/2020 4:55 pm