网站导航免费论文 原创论文 论文搜索 原创论文 网学软件 学术大家 资料中心 会员中心 问题解答 原创论文 大学论文导航 设计下载 最新论文 下载排行 原创论文 论文源代码
返回网学首页
网学联系
最新论文 推荐专题 热门论文 素材专题
当前位置: 网学 > 编程文档 > 网络知识 > 正文

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

来源:http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 14/06/30

以下是网学网为您推荐的网络知识-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 函数文件:

<?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 v3.5 RC2下载

界面预览

  • 软件大小:5.77MB
  • 软件类别:国外软件 | 博客系统
  • 软件语言:多国语言
  • 运行环境:PHP/Mysql
  • 软件授权:开源软件
  • 更新时间:2012-12-1 12:31:54
  • 相关链接:Home Page

本文转自:http://www.wpued.com/7549.html

网学推荐

免费论文

原创论文

设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved 湘ICP备09003080号