Aug 16, 2020 7:13 pm
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)
$('.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
6 Replies
Aug 17, 2020 9:16 am
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.
Aug 17, 2020 2:28 pm
Thank you so much! It works.
Aug 17, 2020 2:45 pm
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?
Aug 18, 2020 12:42 pm
Now when I click login it doesn't even pop up, it just redirects to the homepage.
Aug 18, 2020 12:55 pm
When I re-added the old top code it works again but the add_filter doesn't seem to be doing anything.