The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Trying to add Login...
 
Share:
Notifications
Clear all

Limited Support

Our support team is currently on holiday from December 25, 2025 to January 7, 2026, and replies may be delayed during this period.

We appreciate your patience and understanding while our team is away. Thank you for being part of the wpDiscuz community!

Merry Christmas and Happy Holidays! 🎄

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

7 Posts
2 Users
0 Reactions
6,874 Views
Posts: 5
Topic starter
(@ajoyshop)
Active Member
Joined: 5 years ago
[#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


6 Replies
Asti
Posts: 8205
 Asti
Support
(@asti)
Illustrious Member
Joined: 8 years ago

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. 


Reply
Posts: 5
Topic starter
(@ajoyshop)
Active Member
Joined: 5 years ago

Thank you so much! It works.


Reply
Posts: 5
Topic starter
(@ajoyshop)
Active Member
Joined: 5 years ago

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?


Reply
1 Reply
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8205

@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);
});

Reply
Posts: 5
Topic starter
(@ajoyshop)
Active Member
Joined: 5 years ago

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


Reply
Posts: 5
Topic starter
(@ajoyshop)
Active Member
Joined: 5 years ago

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


Reply
Share: