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 gravatar应用本地头像进步网页关上速度

WordPress默许的头像是读取gravatar.com上的图片的,关于国际用户来说会使网页关上速度变慢。所以我决议删除...

WordPress中创立用户角色的相干PHP函数应用详解

WordPress 默许有 “订阅者”、“投稿者”、“作者”、“编辑” 和 “治理员” 五个用户角色,权限由低到高...

Wordpress(Wp)3.5版修正默许上传图片门路的处理办法

置信接触过WP零碎的冤家都理解,老版零碎的上传图片门路是默许指向wp-content目录下的。做过WP博客的冤家应...

且谈WordPress功能优化分享

作为一款遭到大少数站长欢送的内容治理零碎,WordPress不只有着弱小的治理性能,而且应用不便,即便是老手也...

WordPress自定义表情及其门路的办法

上面解说应用办法: 第一步:下载weisay_smiley.zip,解压,将表情文件夹smiley和smiley.php一同上传到你目...

wordpress首页文章限度显示字数的办法

办法一:应用<!--more-->标签来自在的截取字数 在模板中应用the_content()函数来打印内容,在文章中经过点击...

需求提交

客服服务

亿鸽在线客服系统