url leri _blank yapmak icin
Url leri nofollow yapmak icin
bunlari temanizin functions.php
bundan oncesine ekliyorsunuz
PHP:
function blank_yap($content) {
$text = $content;
preg_match_all("/<a.*? href=\"(.*?)\".*?>(.*?)<\/a>/i", $text, $matches);
for($i=0;$i<count($matches[0]);$i++){
if(!preg_match("/target=[\"\']*_blank[\"\']*/",$matches[0][$i])){
preg_match_all("/<a.*? href=\"(.*?)\"(.*?)>(.*?)<\/a>/i", $matches[0][$i], $matches1);
$text = str_replace(">".$matches1[3][0]."</a>"," target=\"_blank\">".$matches1[3][0]."</a>",$text);
}
}
return $text;
}
add_filter('the_content', 'blank_yap');
Url leri nofollow yapmak icin
PHP:
function nofollow_yap($content) {
$text = $content;
preg_match_all("/<a.*? href=\"(.*?)\".*?>(.*?)<\/a>/i", $text, $matches);
for($i=0;$i<count($matches[0]);$i++){
if(!preg_match("/rel=[\"\']*nofollow[\"\']*/",$matches[0][$i])){
preg_match_all("/<a.*? href=\"(.*?)\"(.*?)>(.*?)<\/a>/i", $matches[0][$i], $matches1);
$text = str_replace(">".$matches1[3][0]."</a>"," rel=\"nofollow\">".$matches1[3][0]."</a>",$text);
}
}
return $text;
}
add_filter('the_content', 'nofollow_yap');
bunlari temanizin functions.php
PHP:
?>