使用方法
1、在模板的`post.php`合适位置加入以下代码:(如果是handsome主题,一般放在`如图一`,其他没有测试请自行试)1、在模板的`post.php`合适位置加入以下代码:(如果是handsome主题,一般放在`如图一`,其他没有测试请自行试)

<!--百度收录--> <li class="meta-baidu"><span class="post-icons"><i class="glyphicon glyphicon-refresh" id="baidu_icon"></i></span><span class="meta-value" id="baidu_result">加载中</span></li>
2、在模板的`post.php`合适位置加入以下代码:(其实在末尾处加以下代码即可)
<!--查询文章在百度是否收录-->
<script>
function baidu_check(){
$.getJSON("https://api.wiiuii.cn/api/shoulu?domain="+window.location.href,function(result){
if (result.code == 200) {
$('#baidu_icon').removeClass('glyphicon-refresh');
$('#baidu_icon').addClass('glyphicon-ok-circle');
$('#baidu_result').text('百度已收录');
}else if(result.code == 403){
$('#baidu_icon').removeClass('glyphicon-refresh');
$('#baidu_icon').addClass('glyphicon-info-sign');
$('#baidu_result').text('百度未收录');
}else{
$('#baidu_icon').removeClass('glyphicon-refresh');
$('#baidu_icon').addClass('glyphicon-remove-circle');
$('#baidu_result').text('查询收录失败');
}
});
}
baidu_check();
</script>
© 版权声明
THE END
喜欢就支持一下吧
请登录后发表评论
注册
社交帐号登录