Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 删除评论作者链接wordpress_Php_Wordpress_Comments_Genesis - Fatal编程技术网

Php 删除评论作者链接wordpress

Php 删除评论作者链接wordpress,php,wordpress,comments,genesis,Php,Wordpress,Comments,Genesis,我有《创世纪》杂志专业主题,我想删除评论作者链接 我使用了许多不同的指南: 我在functions.php中添加了一些代码,但这些方法不起作用 当有人发表评论时,我仍然删除了字段链接,但现在我想删除评论作者链接 如何解决 例如,我想删除“Mr Wordpress”上的链接 谢谢您必须转到: genesis>lib>structure>comments.php 并找到以下行: if ( ! empty( $url ) && 'http://' !== $url ) {$author = sp

我有《创世纪》杂志专业主题,我想删除评论作者链接

我使用了许多不同的指南:

我在functions.php中添加了一些代码,但这些方法不起作用

当有人发表评论时,我仍然删除了字段链接,但现在我想删除评论作者链接

如何解决

例如,我想删除“Mr Wordpress”上的链接

谢谢

您必须转到:

genesis>lib>structure>comments.php

并找到以下行:

if ( ! empty( $url ) && 'http://' !== $url ) {$author = sprintf( '%s', esc_url( $url ), genesis_attr( 'comment-author-link' ), $author );}
并将其替换为新的:

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

如果您不想直接在Genesis上执行此操作,可以将此过滤器粘贴到theme functions.php文件的末尾:

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

享受吧

我认为这是另一回事。我用更具体的信息更新我的答案。谢谢你,斯奇基克,它很管用!!!但通过这种方式,如果将来我更新genesis,它将返回默认状态。有一种方法可以通过其他方式实现吗?:)