实用功能,本文来自转载,在此记录一下,免得以后找不到
修改 comments.php 文件
文件位置 wp-content/themes/zibll/template/comments.php
搜索 邮箱 找到评论区填写框位置,代码添加位置如图所示。
$o_t1 = $require_name_email ? '(可不填)' : '';
//评论区的网址填写框
echo '';
echo '';
echo '网址' . $o_t1 . '';
echo '';
echo '';
echo ' ';
![图片[1]-子比主题添加评论链接填写框[已实装] 图片[1]-子比主题添加评论链接填写框[已实装]](https://pdha.top/wp-content/uploads/pdha.top/2025/10/1759807222603.png)
修改 zib-comments-list.php 文件
文件位置 /wp-content/themes/zibll/inc/functions/zib-comments-list.php
找到 zib_get_comments_user_name 函数,修改为以下内容。
// 初始化用户名称(用户或访客)
$user_name = $user_name ? $user_name : '' . $comment->comment_author . '';
// 新增:处理评论作者URL和作者标签
$author_url = get_comment_author_url($comment->comment_ID);
if (!empty($author_url) && $author_url !== 'http://' && $author_url !== 'https://') {
// 如果存在作者URL,添加外部链接
$user_name = '' . $user_name . '';
}
![图片[2]-子比主题添加评论链接填写框[已实装] 图片[2]-子比主题添加评论链接填写框[已实装]](https://pdha.top/wp-content/uploads/pdha.top/2025/10/1759807224178.png)
感谢您的来访,获取更多精彩文章请收藏本站。
© 版权声明
THE END







![WordPress换域名、批量修改替换网站链接URL最完美教程[新手必看]-胖大海博客资源网](https://oss.zibll.com/zibll.com/2023/09/图片-22.png?x-oss-process=image%2Fquality,q_40%2Fresize,m_fill,w_1024,h_444)







暂无评论内容