成都公司:成都市成華區(qū)建設(shè)南路160號(hào)1層9號(hào)
重慶公司:重慶市江北區(qū)紅旗河溝華創(chuàng)商務(wù)大廈18樓
當(dāng)前位置:工程項(xiàng)目OA系統(tǒng) > 泛普各地 > 湖南OA系統(tǒng) > 益陽OA > 益陽網(wǎng)站建設(shè)公司
WordPress主題調(diào)整教程:修改回復(fù)評(píng)論文字
申請(qǐng)免費(fèi)試用、咨詢電話:400-8352-114
WordPress主題教程之修改wordpress回復(fù)評(píng)論文字方法,首選需要建立個(gè)自定義的評(píng)論模板,然后通過調(diào)用此評(píng)論函數(shù)來實(shí)現(xiàn)自定義。通過以下代碼可以實(shí)現(xiàn)修改回復(fù)文字:
<?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’), 這行是默認(rèn)的回復(fù)評(píng)論。
‘login_text’ => __(‘Reply’), ‘depth’ => 0, ‘before’ => ”, ‘after’ => ”); 這行是登陸后評(píng)論。
comment_reply_link(array_merge( $defaults, array(‘depth’ => $depth, ‘max_depth’ => $args['max_depth']))) 這行是評(píng)論鏈接。
將以上代碼放在評(píng)論 loop 內(nèi)既可使用,下面是完整的 custom_comment.php 函數(shù)文件:

<?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修改回復(fù)文字的方法就這么簡單,試試吧。
本站推薦
- 1Wordpress的Google Blogger格式地址插件
- 2wordpress占用服務(wù)器cup過高解決辦法
- 3WordPress SEO教程:WordPress整站SEO指導(dǎo)
- 4WordPress文章ID不連續(xù)的兩種解決方法
- 5純代碼實(shí)現(xiàn)WordPress評(píng)論者顯示地理位置
- 6HostGator后臺(tái)自帶程序快速安裝wordpress
- 7WordPress博客優(yōu)化:制作搜索引擎友好的面包屑
- 8WordPress函數(shù)實(shí)現(xiàn)將數(shù)據(jù)保存到數(shù)據(jù)庫中
- 9WordPress主題調(diào)整教程:修改回復(fù)評(píng)論文字

