Notifications
Clear all

Remove author's link in comment count

7 Posts
2 Users
0 Reactions
2,228 Views
Posts: 4
Topic starter
(@thanh25896)
New Member
Joined: 5 years ago

I tried add comment counter after author name follow this link

https://gvectors.com/forum/how-to-and-troubleshooting/display-user-comment-number-which-template-for-the-call/

But the comment count have author's link . I want to remove it but I can't although tried many way like 

`.wpdiscuz-comment-count{
pointer-events: none !important;
cursor: default !important;
}`

or

`a..wpdiscuz-comment-count{
pointer-events: none !important;
cursor: default !important;
}`

But nothing chaged . I tried cusor : not-allowed too

6 Replies
Elvina
Posts: 1403
(@elvina)
Support
Joined: 5 years ago

Hi @thanh25896,

Please leave the example URL to allow us to check it.

Also please provide a screenshot of what exactly you want to remove.

Reply
Posts: 4
Topic starter
(@thanh25896)
New Member
Joined: 5 years ago

Example IMG

[img] [/img]

 

And the code in it is :

<div class="wpd-comment-header">
<div class="wpd-comment-author ">
<a href="https://asd.com" rel="noreferrer ugc nofollow" target="_blank">tge <span class="wpdiscuz-comment-count"> <i class="fad fa-comments"></i> 10 </span></a>
</div>
Reply
1 Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@thanh25896,

There are two following options to do that.

1. You can use the following CSS code:

div.wc-comment-author > a {
color: currentColor !important;
cursor: not-allowed !important;
text-decoration: none !important;
pointer-events: none !important;
}

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-comment-author > a").removeAttr("href");

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

Here is the instruction on how to add a js file or js code in the active theme:

https://www.wpbeginner.com/wp-tutorials/how-to-easily-add-javascript-in-wordpress-pages-or-posts/

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. 

 

Reply
Posts: 4
Topic starter
(@thanh25896)
New Member
Joined: 5 years ago

If I add this css code the author name will not have author's link anymore . I just want to remove author's link on comment counts only, not on author name .

Reply
1 Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@thanh25896,

Please remove all codes provided above and use the following one, to get it resolved: 

jQuery(document).delegate('.wpdiscuz-comment-count', 'click', function (e) {
e.preventDefault();
});

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

 

Reply
Posts: 4
Topic starter
(@thanh25896)
New Member
Joined: 5 years ago

This code was block open link when clicked into comments count but still show the author link when the cursor move into the comments count

Reply
Share:
Scroll to top