Skip to content

Instantly share code, notes, and snippets.

@auzeonfung
Last active August 29, 2015 13:57
Show Gist options
  • Save auzeonfung/9833831 to your computer and use it in GitHub Desktop.
Save auzeonfung/9833831 to your computer and use it in GitHub Desktop.
<span class="tsukkomi">
<?php if ($depth == get_option('thread_comments_depth')) : ?> <!-- 评论深度等于设置的最大深度 -->
<!-- 将第二个参数改为父一级评论的id -->
<a onclick="return addComment.moveForm( 'comment-<?php comment_ID() ?>','<?php echo $comment->comment_parent; ?>', 'respond','<?php echo $comment->comment_post_ID; ?>'" href="#comment-<?php comment_ID() ?>" class="comment-reply-link">回复</a>
<?php else: ?>
<!-- 正常情况 -->
<a onclick="return addComment.moveForm( 'comment-<?php comment_ID() ?>','<?php comment_ID() ?>', 'respond','<?php echo $comment->comment_post_ID; ?>'" href="#comment-<?php comment_ID() ?>" class="comment-reply-link" >回复</a>
<?php endif; ?>
</span>
Outpt:
=========================
<span class="tsukkomi">
<!-- 正常情况 -->
<a onclick="return addComment.moveForm( 'comment-13','13', 'respond','1'" href="#comment-13" class="comment-reply-link">回复</a>
</span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment