
小极 
0 学习一下2年前江苏

留有遗憾 
0 感谢前来看看2年前福建

文龍 
0 感谢前来看看2年前安徽

໑ຼₒ₂₄ღ᭄ꫛ张꧔ꦿ᭄ 
0 感谢前来看看2年前河南

北瓜君 
0 感谢前来看看2年前湖北

redeyes 
0 感谢老大分享2年前重庆

梦楠 
0 谢谢分享2年前上海

初晨-ccyuanma.com 
0 //WordPress文章关键词自动内链 大白博客 function tag_sort($a, $b){ if ( $a->name == $b->name ) return 0; return ( strlen($a->name) > strlen($b->name) ) ? -1 : 1; } function tag_link($content){ $match_num_from = 1; //一个标签少于几次不链接 $match_num_to = 1; //一个标签最多链接几次 $posttags = get_the_tags(); if ($posttags) { usort($posttags, "tag_sort"); foreach($posttags as $tag) { $link = get_tag_link($tag->term_id); $keyword = $tag->name; //链接代码 $cleankeyword = stripslashes($keyword); $url = "".addcslashes($cleankeyword, '$').""; $limit = rand($match_num_from,$match_num_to); //不链接代码 $content = preg_replace( '|(]+>)(.*)('.$ex_word.')(.*)(]*>)|U'.$case, '$1$2%&&&&&%$4$5', $content); $content = preg_replace( '|()|U'.$case, '$1$2%&&&&&%$4$5', $content); $cleankeyword = preg_quote($cleankeyword,'\''); $regEx = '\'(?!((<.*?)|(<a.*?)))('. $cleankeyword . ')(?!(([^]*?)>)|([^>]*?))\'s' . $case; $content = preg_replace($regEx,$url,$content,$limit); $content = str_replace( '%&&&&&%', stripslashes($ex_word), $content); } } return $content; } add_filter('the_content','tag_link',1);2年前

番茄坤 
0 谢谢分享2年前广东

qinxi1 
0 谢谢分享2年前湖南
回复222
只看作者最新最热
加载更多











