0
如何將rel =「nofollow」添加到具有時間標記的鏈接中,在comment-metadata div內部?add rel =「nofollow」to comment_metadata
<div class="comment-metadata">
<a href="http://localhost/wordpress/hello-world/#comment-2">
<time datetime="2013-12-22T10:43:03+00:00">...</time>
</a>
</div>
function add_nofollow_to_comment_metadata($link) {
return str_replace('")\'>', '")\' rel=\'nofollow\'>', $link);
}
add_filter('comment_comment_metadata', 'add_nofollow_to_comment_metadata');
我使用<?php wp_list_comments(); ?>
沒有任何自定義。
如果wordpress這樣做,爲什麼我問這個問題? :) – newbie