中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

修改wordpress回復(fù)評論文字的方法

2019-12-30    來源:愛站科技

容器云強勢上線!快速搭建集群,上萬Linux鏡像隨意使用

在學(xué)習(xí)WordPress的時候是不是對修改wordpress回復(fù)評論文字的方法非常好奇呢?那么今天我們就帶著這個問題一起跟小編去看看具體是如何修改wordpress回復(fù)評論文字的吧。

  WordPress主題教程之修改wordpress回復(fù)評論文字方法,首選需要建立個自定義的評論模板,然后通過調(diào)用此評論函數(shù)來實現(xiàn)自定義,通過以下代碼可以實現(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(‘a(chǎn)dd_below’ => ‘comment’, ‘respond_id’ => ‘respond’, ‘reply_text’ => __(‘Reply’)

  這行是默認(rèn)的回復(fù)評論。

‘login_text’ => __(‘Reply’), ‘depth’ => 0, ‘before’ =>, ‘a(chǎn)fter’ =>); 

  這行是登陸后評論。

comment_reply_link(array_merge( $defaults, array(‘depth’ => $depth, ‘max_depth’ => $args['max_depth']))) 

  這行是評論鏈接。

 將以上代碼放在評論 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ù)文字的方法就這么簡單,試試吧。

上文中小編介紹了修改wordpress回復(fù)評論文字的方法,如果您想查看更多相關(guān)內(nèi)容就請關(guān)注西部數(shù)碼技術(shù)頻道吧,感謝您的支持!

標(biāo)簽: wordpress 回復(fù)評論文字

版權(quán)申明:本站文章部分自網(wǎng)絡(luò),如有侵權(quán),請聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點!
本站所提供的圖片等素材,版權(quán)歸原作者所有,如需使用,請與原作者聯(lián)系。

上一篇:wordpress頂部空白怎么辦

下一篇:WordPress如何設(shè)置防盜鏈