在函数中。我的主题的php文件。commentslist显示一个gravatar,如果用户在评论表单中填写url,则会得到一个
comment_author_link()
打印一个带有名称的链接。我想在周围放置一个链接。头像图像(如果有链接)。资源中有很多(https://developer.wordpress.org/?s=comment_author&post_type[]=wp-parser-function&post_type[]=wp-parser-hook&post_type[]=wp-parser-class&post_type[]=wp-parser-method).
可能是这样,但这不起作用:
<?php if ( has_comment_author_link() ) : ?>
<a href="<?php echo comment_author_url();?>" target="_blank">
<?php endif; ?>
<?php echo get_avatar( $comment, $size=\'75\' ); ?>
<?php if ( has_comment_author_link() ) : ?>
</a>
<?php endif; ?>
但没有这样的“has_comment_author_link
“我不知道该怎么做。谢谢