Notifications
Clear all

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

14 Posts
4 Users
1 Likes
1,601 Views
(@chussman)
Active Member
Joined: 5 years ago
Posts: 6
Topic starter  

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
(@astgh)
Illustrious Member Admin
Joined: 6 years ago
Posts: 5872
 

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 reacted
(@chussman)
Active Member
Joined: 5 years ago
Posts: 6
Topic starter  

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)
Active Member
Joined: 5 years ago
Posts: 6
Topic starter  

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
(@astgh)
Illustrious Member Admin
Joined: 6 years ago
Posts: 5872
 

@chussman,

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

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

   
(@chussman)
Active Member
Joined: 5 years ago
Posts: 6
Topic starter  

@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
(@astgh)
Illustrious Member Admin
Joined: 6 years ago
Posts: 5872
 

@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)
Active Member
Joined: 5 years ago
Posts: 6
Topic starter  

@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
(@astgh)
Illustrious Member Admin
Joined: 6 years ago
Posts: 5872
 

@chussman,

You can follow this instruction:

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


   
(@chussman)
Active Member
Joined: 5 years ago
Posts: 6
Topic starter  

@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
(@astgh)
Illustrious Member Admin
Joined: 6 years ago
Posts: 5872
 

@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-gonzalez)
Member Customer
Joined: 4 years ago
Posts: 10
 

@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)
Support
Joined: 5 years ago
Posts: 1403
 

@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-gonzalez)
Member Customer
Joined: 4 years ago
Posts: 10
 

@elvina

Now is perfect, thanks!!


   
Share:
Scroll to top