可按Ctrl+D收藏 蚂蚁资源网

蚂蚁资源网

wordpress回复评论文字的修改方法

  • 时间:2020-12-11 09:57 编辑:赵英敏 来源:蚂蚁资源网 阅读:218
  • 扫一扫,手机访问
摘要:本文围绕WordPress   回复   评论   评论  讲述关于wordpress回复评论文字的修改方法的相关知识,精彩详情内容请仔细阅读以下内容。感谢支持!
大家好,今小编要介绍的是关于wordpress回复评论文字的修改方法的相关内容,多方面分析说明,感兴趣朋友的可以参考学习。

关键词:WordPress   回复   评论   评论  

  WordPress主题教程之修改wordpress回复评论文字方法,首选需要建立个自定义的评论模板,然后通过调用此评论函数来实现自定义,通过以下代码可以实现修改回复文字:

<?php$defaults = array('add_below' => 'comment', 'respond_id' => 'respond', 'reply_text' => __('Reply'),'login_text' => __('Reply'), 'depth' => 0, 'before' => '', 'after' => '');comment_reply_link(array_merge( $defaults, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

  你可以将 Reply 修改成你希望的文字。

$defaults = array(‘add_below’ => ‘comment’, ‘respond_id’ => ‘respond’, ‘reply_text’ => __(‘Reply’)

  这行是默认的回复评论。

‘login_text’ => __(‘Reply’), ‘depth’ => 0, ‘before’ => ”, ‘after’ => ”); 

  这行是登陆后评论。

comment_reply_link(array_merge( $defaults, array(‘depth’ => $depth, ‘max_depth’ => $args['max_depth']))) 

  这行是评论链接。

 将以上代码放在评论 loop 内既可使用,下面是完整的 custom_comment.php 函数文件:

<?phpif (!function_exists("custom_comment")) {function custom_comment($comment, $args, $depth) {$GLOBALS['comment'] = $comment; ?><li <?php comment_class(); ?>><a name="comment-<?php comment_ID() ?>"></a><?php if(get_comment_type() == "comment"){ ?><?php the_commenter_avatar($args) ?><?php } ?><?php$defaults = array('add_below' => 'comment', 'respond_id' => 'respond', 'reply_text' => __('Reply'),'login_text' => __('Reply'), 'depth' => 0, 'before' => '', 'after' => '');comment_reply_link(array_merge( $defaults, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?><?php the_commenter_link() ?><?php echo get_comment_date(get_option( 'date_format' )) ?> <?php _e('at', 'jintu'); ?> <?php echo get_comment_time(get_option( 'time_format' )); ?><?php edit_comment_link(__('Edit', 'jintu'), '', ''); ?><?php comment_text() ?><?php if ($comment->comment_approved == '0') { ?><p class='unapproved'><?php _e('Your comment is awaiting moderation.', 'jintu'); ?></p><?php } ?><?php}} ?>

  将上面的代码保存到 custom_comment.php 文件, 在functions.php里加载即可,wordpress修改回复文字的方法就这么简单,试试吧。


以上就是wordpress回复评论文字的修改方法的全部内容,希望可以帮助到您。感谢对蚂蚁资源网的支持。
(责任编辑:赵英敏)

版权声明:文章内容是蚂蚁资源网小编精心整合原创的,素材来源于互联网,如无意侵犯到您的权益,请联系网站客服核实版权信息,以便及时删除。
  • 全部评论(0)
最新发布的资讯信息
【简历/资料|内地女明星】 殷茹基本资料( YR个人简历介绍)(2020-12-06 15:19)
【简历/资料|内地女明星】 曹菁基本资料( CJ个人简历介绍)(2020-12-06 15:18)
【简历/资料|内地女明星】 王安妮基本资料( WAN个人简历介绍)(2020-12-06 15:18)
【简历/资料|内地女明星】 白琼基本资料( BQ个人简历介绍)(2020-12-06 15:17)
【简历/资料|内地女明星】 王世霞基本资料( WSX个人简历介绍)(2020-12-06 15:17)
【简历/资料|内地女明星】 宋煜基本资料( SY个人简历介绍)(2020-12-06 15:16)
【简历/资料|内地女明星】 钱增基本资料( QZ个人简历介绍)(2020-12-06 15:16)
【简历/资料|内地女明星】 胡晓黎基本资料( HXL个人简历介绍)(2020-12-06 15:15)
【简历/资料|内地女明星】 李佳慧基本资料( LJH个人简历介绍)(2020-12-06 15:15)
【简历/资料|内地女明星】 张洛嘉基本资料( ZLJ个人简历介绍)(2020-12-06 15:14)
联系客服
网站客服 联系客服
手机版

扫一扫进手机版
返回顶部