Merhaba arkadaşlar,
function auto_link_tags($content){
//$post_id = get_the_ID();
$post_tags = get_the_tags();
if ($post_tags) {
$i = 0;
foreach($post_tags as $tag) {
$tags[$i] = "~<(?:a\\s.*?</a>|[^>]+>)(*SKIP)(*FAIL)|\\b(?:\\b(" . $tag->name . ")\\b(?=[^>]*(<|$)))\\b~i";
$tag_url = get_tag_link($tag->term_id);
$tag_html[$i] = '<a style="color:#FF0000;" href="' . $tag_url . '" rel="tag" title="$1">$1</a>';
$i++;
}
$content = preg_replace($tags, $tag_html, $content);
}
return $content;
}Şu etiketleri otomatik linkliyor, ama yazıda 10 tane aynı kelime varsa hepsine link veriyor, her etiket için sadece 1'ine link vermesini sağlayabilecek varmı?