最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
wodpress博客的评论外链加上跳转的方法
时间:2015-11-03 编辑:简简单单 来源:一聚教程网
昨天的时候修改了一下博客的评论里的外链,有外链转内链,折腾了一下博客,看看效果还行,下面分享一下
模板function.php添加下面的代码
/**博客的评论里的外链转内链**/
add_filter('get_comment_author_link','add_redirect_comment_link', 5);
add_filter('comment_text', 'add_redirect_comment_link', 99);
function add_redirect_comment_link($text= ''){
$text=str_replace('href="','href="'.get_option('home').'/goto.php?url=', $text);
$text=str_replace("href='","href='".get_option('home')."/goto.php?url=", $text);
return$text;
}
上面的代码其实就是把页面显示的链接都修改成http://www.111com.net /goto.php?url=【网站链接】
新建goto.php,放到跟目录下
搞定了,有问题请留言
-
下一个: js对象的浅拷贝和深拷贝
相关文章
- HTML简单购物数量小程序代码展示 10-31
- html canvas实现弹幕功能 10-31
- HTML中空格表示的意义 10-31
- html area标签解读 10-31
- html使用表单标签实现注册页面代码展示 10-31
- 使用HTML截图并保存为本地图片的代码展示 10-31