comment_reply_link()

Usage

<?php comment_reply_link( $args, $comment, $post ) ?>

-------------------------------------------------------

Parameters

$args
(数组)(可选)关联数组可改写默认选项
Default: array

$comment
(整数)(可选)接收回复的评论

$post
(整数)(可选)评论所属文章

-------------------------------------------------------

Arguments

以下参数都可以被$args参数改写

add_below
(字符串)该参数用于JavaScript的moveAddCommentForm()函数的参数。默认值为'post'。

respond_id
(整数)该参数用于JavaScript的moveAddCommentForm()函数的参数。默认值为'respond'。

reply_text
(字符串)仅在用户能够进行回复时使用。默认值为'Reply'。

login_text
(字符串)仅在用户必须登录或注册以发表评论时使用。默认值为 'Log in to leave a comment'(登录后方可发表评论)。

depth
(整数)

-------------------------------------------------------

今天在虎头鱼博客看到有人问如何把Reply替换为回复这两个字,得到的答案是换成中文版的WordPress。

其实可以通过修改functions.php中的comment_reply_link()来完成,比如我现在的主题。

<?php comment_reply_link(array_merge( $args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

修改为

<?php comment_reply_link(array_merge( $args, array(‘reply_text’ => ‘回复’,'add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

{ 发表评论? }

  1. 百奥博

    wordpress就是一个多解题

  2. 一阵风

    .jpg

    回复连接出现嵌套情况,该怎么改?

发表评论

电子邮件地址不会被公开。

 smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

无觅相关文章插件,快速提升流量