简体   繁体   中英

Remove comment author link wordpress

i have Genesis Magazine Pro Theme and i want to delete comment author link.

I use many different guide:

http://wpsquare.com/remove-comment-author-website-link-wordpress/

https://www.engagewp.com/remove-wordpress-comment-author-link/

I add some code in functions.php, but these method doesn't work

I have still remove the field link when someone post a comment, but now i want to remove the comment author link .

How to resolve it?

For example, i want to remove the link on " Mr Wordpress ".

在此处输入图片说明 Thanks

In case that you don't want to do it directly on Genesis, you can paste this filter at the end of your theme functions.php file:

function filter_get_comment_author_url( $url, $id, $comment ) {
    return "";
}
add_filter( 'get_comment_author_url', 'filter_get_comment_author_url', 10, 3);

Enjoy!

You have to go to:

genesis > lib > structure > comments.php

And find the following line:

if ( ! empty( $url ) && 'http://' !== $url ) {$author = sprintf( '%s', esc_url( $url ), genesis_attr( 'comment-author-link' ), $author );}

And replace it with this new:

if ( ! empty( $url ) && 'http://' !== $url ) {$author = sprintf($author );}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM