加入收藏 | 设为首页 | 会员中心 | 我要投稿 济源站长网 (https://www.0391zz.cn/)- 数据工具、数据仓库、行业智能、CDN、运营!
当前位置: 首页 > 教程 > 正文

wodpress博客的评论外链加上跳转的方法推荐

发布时间:2022-06-22 17:13:59 所属栏目:教程 来源:互联网
导读:wodpress博客的评论外链已经是许多博主不可接受的一种程度了,我们下面来给各位介绍一篇把外连通过修改成跳转的连接了,这样不会影响到网站权重了. 昨天的时候修改了一下博客的评论里的外链,有外链转内链,折腾了一下博客,看看效果还行,下面分享一下. 模板funct
  wodpress博客的评论外链已经是许多博主不可接受的一种程度了,我们下面来给各位介绍一篇把外连通过修改成跳转的连接了,这样不会影响到网站权重了.
 
  昨天的时候修改了一下博客的评论里的外链,有外链转内链,折腾了一下博客,看看效果还行,下面分享一下.
 
  模板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); //phpfensi.com
    return$text;
  }
  上面的代码其实就是把页面显示的链接都修改成http://www.phpfensi.com/goto.php?url=【网站链接】
 
  新建goto.php,放到跟目录下.
 
  <!doctype html>
  <html lang="en">
  <head>
  <meta charset="UTF-8">
  <meta name="Author" content="">
wodpress博客的评论外链加上跳转的方法推荐
  border-radius: 100%;
  display: inline-block;
  -webkit-animation: bouncedelay 1.4s infinite ease-in-out;
  animation: bouncedelay 1.4s infinite ease-in-out;
  /* Prevent first frame from flickering when animation starts */
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
  }
  
  .spinner .bounce1 {
  -webkit-animation-delay: -0.32s;
  animation-delay: -0.32s;
  background-color: #428bca;
  }
  
  .spinner .bounce2 {
  -webkit-animation-delay: -0.16s;
  animation-delay: -0.16s;
  background-color: #Dd534F;
  }
  
  .spinner .bounce3 {
  -webkit-animation-delay: -0.01s;
  animation-delay: -0.01s;
  background-color: #67CF22;
  }
  
  @-webkit-keyframes bouncedelay {
  0%, 80%, 100% { -webkit-transform: scale(0.0) }
  40% { -webkit-transform: scale(1.0) }
  }
  
  搞定了,有问题请留言.
 
 

(编辑:济源站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读