yumijie 发表于 2019-3-25 14:54:27

sgwyhwt 发表于 2019-3-25 13:18
www.mrkevin.net

大佬能做个友情链接吗?

bxz 发表于 2019-3-25 14:57:06

sgwyhwt 发表于 2019-3-25 13:18
www.mrkevin.net

我也想做一个像你这样的博客,奈何技术不够。。。

bxz 发表于 2019-3-25 15:02:17

糯米团 发表于 2019-3-25 14:41
liuguogy.com

喜欢你的博客,想要:Q

hyllgf 发表于 2019-3-25 15:08:34

全靠楼主了http://vpstx.top/

带头盔滴衰锅 发表于 2019-3-25 15:11:51

usebsd.com 全靠大佬了

1215648344 发表于 2019-3-25 15:17:33

cn4.host

连连看 发表于 2019-3-25 15:18:17

那么牛?又来膜拜大佬了

3000 发表于 2019-3-25 15:19:34

www.vpsbm.com
VPS保姆,欢迎收藏

境界 发表于 2019-3-25 15:34:39

pxy185 发表于 2019-3-25 13:27
怎么做啊 大佬 www.huiju.in

https://ws1.sinaimg.cn/large/7ae2f8cdly1g1f2epgupvj20ip0dj0tm.jpg


大佬,这个怎么弄的

pxy185 发表于 2019-3-25 15:53:21

境界 发表于 2019-3-25 15:34
大佬,这个怎么弄的

//百度收录展示
function baidu_check($url){
    global $wpdb;
    $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
    $baidu_record= get_post_meta($post_id,'baidu_record',true);
    if( $baidu_record != 1){
      $url='http://www.baidu.com/s?wd='.$url;
      $curl=curl_init();
      curl_setopt($curl,CURLOPT_URL,$url);
      curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
      $rs=curl_exec($curl);
      curl_close($curl);
      if(!strpos($rs,'没有找到')){
            if( $baidu_record == 0){
                update_post_meta($post_id, 'baidu_record', 1);
            } else {
                add_post_meta($post_id, 'baidu_record', 1, true);
            }   
                return 1;
      } else {
            if( $baidu_record == false){
                add_post_meta($post_id, 'baidu_record', 0, true);
            }   
            return 0;
      }
    } else {
       return 1;
    }
}
function baidu_record() {
    if(baidu_check(get_permalink()) == 1) {
      echo '<a style="color:green;font-size:12px;float: right;" target="_blank" title="点击查看" rel="external nofollow" href="http://www.baidu.com/s?wd='.get_the_title().'"><i class="fa fa-paw fa-lx"></i>百度已收录</a>';
   } else {
      echo '<a style="color:red;font-size:12px;float: right;" rel="external nofollow" title="点击提交,谢谢您!" target="_blank" href="http://zhanzhang.baidu.com/sitesubmit/index?sitename='.get_permalink().'"><i class="fa fa-paw fa-lx"></i>百度未收录</a>';
   }
}




上面代码复制到functions.php文件中,
======================================



然后找到文章模板一般是 single.php

       
把下列代码添加到相应的位置
<?php baidu_record(); ?>
页: 1 2 3 [4] 5 6 7 8 9 10 11
查看完整版本: 晒出你们的博客,我给你们做seo