The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
[Solved] How to change the login link class??
How-to and Troubleshooting
(@civilenggnotes)
Eminent Member
Joined: 6 years ago
Hello,
I am using a pop up login plugin where i need to add class in link to trigger the pop up, like <a href="#Login" class="lrm-login lrm-hide-if-logged-in" > Login </a> to trigger pop up login when clicked on login text.
Now, in the User Authorization and Profile Data option in the setting i could found the login url, but don't know how to do that.
Please guide me regarding this..
(@asti)
Illustrious Member
Joined: 8 years ago
Hi @civilenggnotes,
You should find all classes that are added on the popup window in the plugin and put it in the class attributes (the red marked codes are just an example, in your case, it may differ) in the code below:
add_filter("wpdiscuz_login_link", function ($login) {
return str_replace(" href=", " class='swal-menu-item sw-open-login' href=", $login);
});
Put the code in the WordPress active theme functions.php file (more information how to add insert custom code):
(@civilenggnotes)
Joined: 6 years ago
Eminent Member
Posts: 23
Jan 15, 2021 9:11 am
@asti
Sorry.. i couldn't understand where to find and replace code.
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8190
Jan 15, 2021 9:13 am
@civilenggnotes,
Put the code in the WordPress active theme functions.php file. More information on how to add insert custom code you can find here: https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/
(@civilenggnotes)
Joined: 6 years ago
Eminent Member
Posts: 23
Jan 15, 2021 9:16 am
@asti
Thanks a lot.. I will try this and let you know if i face any other problems or it works..
(@civilenggnotes)
Joined: 6 years ago
Eminent Member
Posts: 23
Jan 15, 2021 5:24 pm
hi @asti
i just added the code you provided, and make the necessary changes. but the problem I am facing now is that when I am clicking on the login link, it is getting refreshed with URL like example.com/test-post/?redirect_to=example.com/test-post and then again I need to click the login link.
Please have a look at https://www.civilenggnotes.in/differences-between-tmt-bars-hysd-bars/
(@civilenggnotes)
Joined: 6 years ago
Eminent Member
Posts: 23
Jan 15, 2021 5:36 pm
i add these lines in theme's function.php file.
add_filter("wpdiscuz_login_link", function ($login) {
return str_replace(" href=", " class='lrm-login lrm-hide-if-logged-in' href=", $login);
});
(@civilenggnotes)
Joined: 6 years ago
Eminent Member
Posts: 23
Jan 15, 2021 7:58 pm
@asti
I guess it was some cache problem, which is now solved I guess.