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 函数文件:

<?php
if (!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回复评论文字的修改方法》的一些看法。更多内容请查看本栏目更多内容!

本文相关话题: wordpress 回复 评论
版权声明:本文为 安达网络工作室 转载文章,如有侵权请联系我们及时删除。
相关文章
WORDPRESS文章中微信打赏性能的2种完成办法

本文实例讲述了WORDPRESS文章中微信打赏性能的2种完成办法。分享给大家供大家参考,详细如下: 打赏性能性能...

详解WordPress中的头像缓存和代理中的缓存更新办法

wordpress评论中的头像是应用Gravatar的头像效劳(Gravatar民间注册地址:http://en.gravatar.com),用户的...

应用扫除法处理模板上的成绩

在wordpress模板制造进程中,有一些貌似复杂的成绩,其实只需确定了成绩呈现的地位,大少数都能够自行处理。...

Ubuntu效劳器上的最优WordPress计划

WordPress是一个经典而又弱小的博客顺序,并且易于装置与搭建,在OpenShift上不花半分钟就能够收费建起一个...

wordpress定时义务(wp-cron.php)造成主机CPU比拟高的处理方法

自从用了阿里云主机,真是没有省心过。 这两天网站CPU天天100+的,过一会就挂了,原来是wp-cron.php文件造成...

WordPress 无Gzip模块主机完成Gzip紧缩js和css

明天给大家引见两个兄弟版的WordPress插件:WP CSS和WP JS,作者都是Halmat Ferello。 WP CSS WP CSS能主动...

需求提交

客服服务

亿鸽在线客服系统