有时候荒岛用户之间会有一些互动,互相回复,尽管我的荒岛开启了嵌套评论,有时候评论者到底回复给谁还不是那么直观,不写入数据库只在前台评论列表显示 @ 评论者 ,荒岛本次带来 WordPress 评论回复添加 @ 显示效果的教程,只要将下面的代码添加到主题的「functions.php」文件即可。
// 荒岛一座藏有宝藏的小岛 function comment_at( $comment_text, $comment = '') { global $comment; if( @$comment->comment_parent > 0) { $comment_text = '<span class="at">@ <a href="#comment-' . $comment->comment_parent . '">'.get_comment_author( $comment->comment_parent ) . '</a></span> ' . $comment_text; } return $comment_text; } add_filter( 'comment_text' , 'comment_at', 20, 2);宝藏内容来自荒岛-https://x-imagine.com/wordpress-comment-reply-add.html宝藏内容来自荒岛-https://x-imagine.com/wordpress-comment-reply-add.html
请按 Ctrl+D 收藏荒岛分享给好友 如您发现本文件已经失效无法下载请联系站长修正
荒岛公众号
扫一扫关注

HDsoft27
公众号ID已复制,前往微信关注...
荒岛小程序
扫一扫关注

ximagine
哔哩姬ID已复制,前往B站关注...