Notifications
Clear all

[Solved] Change login page to comment in wp-discuzz plugin  

  RSS

chussman
(@chussman)
Active Member
Joined: 7 months ago
Posts: 6
25/09/2019 5:56 pm  

Hi,

I need to change login page to comment on Wp Discuzz plugin because i've hide wp-login.php page.

 

Is it possible?


Topic Tags
Astghik
(@astghik)
Support Team Admin
Joined: 2 years ago
Posts: 3785
25/09/2019 5:59 pm  

Hi @chussman,

You should put a small code in theme functions.php file. Please read this support topic and change the /login slug to whatever uses the plugin:

https://wordpress.org/support/topic/change-link-for-login-link-text/


chussman liked
chussman
(@chussman)
Active Member
Joined: 7 months ago
Posts: 6
25/09/2019 6:09 pm  

Hi,

 

Thanks for you response, very fast! Congratulations.

 

I've added this code on functions.php

but i have a problem, i'm going to Home after login, and i would like to redirect to same post to start to comment.

How i can fix this issue?


chussman
(@chussman)
Active Member
Joined: 7 months ago
Posts: 6
25/09/2019 6:53 pm  

Hi again,

 

I think i can resolve my new issue, i only need add a custom class to <a> link login.

How i can add it??

Thanks so much!

 

 


Astghik
(@astghik)
Support Team Admin
Joined: 2 years ago
Posts: 3785
25/09/2019 7:00 pm  

@chussman,

Just add the following js code in your active theme's js files: 

jQuery( ".wpdiscuz-form-top-bar span a" ).addClass( "myClass" );

chussman
(@chussman)
Active Member
Joined: 7 months ago
Posts: 6
25/09/2019 8:40 pm  

@astghik

Thanks so much, i will try to do it, but i have to looking for how to do it first.

 

So, i have a new problem: When user is logged in, the username has a link to his profile, i've disabled profile url from plugin options but it doesn't works.

 

Can you help me?


Astghik
(@astghik)
Support Team Admin
Joined: 2 years ago
Posts: 3785
26/09/2019 1:09 pm  

@chussman,

There are two following options:

1. You can use the following CSS code:

#wc_show_hide_loggedin_username a:first-child {
   color: currentColor;
   cursor: not-allowed;
   text-decoration: none;
   pointer-events: none;
}

The CSS code should be added in the Dashboard > Comments > Settings > Styling > "Custom CSS code" textarea. 

2. or you can use the following JS code:

jQuery( "#wc_show_hide_loggedin_username a:first-child " ).removeAttr("href");

The js code you should add in your active them's js files.

In any case, please don't forget to delete all caches and press Ctrl+F5 (twice) on the frontend before checking to reload the updated CSS/JS files.     


chussman
(@chussman)
Active Member
Joined: 7 months ago
Posts: 6
30/09/2019 10:41 am  

@astghik

Hi, thanks for your response, but i don't know how to add JS code on my theme.

Im using Avada theme, can you help me? Thanks!


Astghik
(@astghik)
Support Team Admin
Joined: 2 years ago
Posts: 3785
30/09/2019 11:19 am  

@chussman,

You can follow this instruction:

https://www.collectiveray.com/wp/tips/add-javascript-to-wordpress


chussman
(@chussman)
Active Member
Joined: 7 months ago
Posts: 6
30/09/2019 11:33 am  

@astghik

Hi! Thanks for your response. Im registered a custom JS file on my website and it's loading fine, but i think the JS file is not correct.

My JS file only has this content, I don't have Javascript knowledge, sorry: 

 

add_action( 'wp_head', function () { ?>
<script>

jQuery( ".wpdiscuz-form-top-bar span a" ).addClass( "lrm-login" );

</script>
<?php } );

 

But is not doing anything

 

🙁


Astghik
(@astghik)
Support Team Admin
Joined: 2 years ago
Posts: 3785
30/09/2019 4:14 pm  

@chussman

Using this code you've just added class to the element:

jQuery( ".wpdiscuz-form-top-bar span a" ).addClass( "lrm-login" )

Now you'll need to add some CSS rules if you want to see the result.
For example:

.lrm-login{
color: red !important
}

The CSS code should be added in te Dashboard > Comments > Settings > Styling > "Custom CSS Code" textarea.


Alfonso González
(@alfonso-gonzalez)
Member Customer
Joined: 6 months ago
Posts: 10
04/10/2019 11:00 am  

@astghik

Hi im using your code:

jQuery( "#wc_show_hide_loggedin_username a:first-child " ).removeAttr("href");

to remove link but i have an issue:

When im logged in, the <a> tag continues displaying but without link and the hover effect is displaying, so i change my css code to:

 

#wc_show_hide_loggedin_username a {
color: #000 !important;
}

#wc_show_hide_loggedin_username a:hover {
color: #000 !important;
}

But the "Exit" link loose the hover effect too.

Sin título

 

Is possible to remove <a> in username when is logged in??

 

 


Elvina
(@elvina)
Honorable Member Moderator
Joined: 7 months ago
Posts: 711
04/10/2019 2:22 pm  

@alfonso-gonzalez,

Please follow these steps below:

1.Delete the CSS codes, added by you:

#wc_show_hide_loggedin_username a {
color: #000 !important;
}
#wc_show_hide_loggedin_username a:hover {
color: #000 !important;
}

2. put following CSS code in the "Custom CSS code" textarea:

wc_show_hide_loggedin_username a:first-child:hover{
color: #000 !important;
}

Please don't forget to delete all caches before checking.


Alfonso González
(@alfonso-gonzalez)
Member Customer
Joined: 6 months ago
Posts: 10
04/10/2019 2:34 pm  

@elvina

Now is perfect, thanks!!


Share: