监理公司管理系统 | 工程企业管理系统 | OA系统 | ERP系统 | 造价咨询管理系统 | 工程设计管理系统 | 签约案例 | 购买价格 | 在线试用 | 手机APP | 产品资料
X 关闭
益阳网站建设公司

当前位置:工程项目OA系统 > 泛普各地 > 湖南OA系统 > 益阳OA > 益阳网站建设公司

WordPress主题调整教程:修改回复评论文字

申请免费试用、咨询电话:400-8352-114

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修改回复文字的方法就这么简单,试试吧。

发布:2007-03-31 14:04    编辑:泛普软件 · xiaona    [打印此页]    [关闭]
相关栏目:
相关文章:
益阳OA
联系方式

成都公司:成都市成华区建设南路160号1层9号

重庆公司:重庆市江北区红旗河沟华创商务大厦18楼

咨询:400-8352-114

加微信,免费获取试用系统

QQ在线咨询

泛普益阳网站建设公司其他应用

益阳软件开发公司 益阳门禁系统 益阳物业管理软件 益阳仓库管理软件 益阳餐饮管理软件 益阳网站建设公司