本教程针对报白域名…. 无防红作用. 请老板们自行检查自己的域名属于那种情况~.
QQ里打开网站的时候,不会直接打开,而是提示使用浏览器打开!
展示图:
把下列代码放入子主题 functions.php 文件中
// 添加PHP文件
define('inlo_func', 'wp-content/themes/b2child/php'); // 定义集体 php 所在的文件夹 inc
function inlo_reqUIreAll( $dir ){ // require_once 集体引用 php
foreach( glob( "{$dir}/*.php" ) as $filename )
require_once $filename;
}
inlo_requireAll( inlo_func ); // 执行函数
<?php if ((strpos($_SERVER['HTTP_USER_AGENT'], 'QQ/') || strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false)) : ?>
<?php $siteurl = ($_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>
<meta charset="UTF-8">
<title>使用浏览器打开</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<style>
body,html{width:100%;height:100%}*{margin:0;padding:0}body{background-color:#fff}.top-bar-guidance{font-size:15px;color:#fff;height:70%;line-height:1.8;padding-left:20px;padding-top:20px;background:url(//cdn.jsdelivr.net/gh/HaoOuBa/BlogStatic/usr/uploads/2021/05/4203917515.png) center top/contain no-repeat}.top-bar-guidance .icon-safari{width:25px;height:25px;vertical-align:middle;margin:0 .2em}.app-download-btn{display:block;width:214px;height:40px;line-height:40px;margin:18px auto 0 auto;text-align:center;font-size:18px;color:#2466f4;border-radius:20px;border:.5px #2466f4 solid;text-decoration:none}
</style>
</head>
<body>
<div class="top-bar-guidance">
<p>点击右上角<img src="//cdn.jsdelivr.net/gh/HaoOuBa/BlogStatic/usr/uploads/2021/05/183124684.png" class="icon-safari"> <span id="openm">Safari打开</span></p>
<p>可以继续浏览本站哦~</p>
</div>
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js"></script>
<a data-clipboard-text="<?php echo $siteurl; ?>" class="app-download-btn">点此复制本站网址</a>
<script type="text/javascript">
new ClipboardJS(".app-download-btn");
document.querySelector(".app-download-btn").onclick = function () {
alert("复制成功!")
}
</script>
</body>
</html>
<?php exit; ?>
<?php endif; ?>
在b2child下新建一个php文件夹,新建一个qq.php文件 把代码复制进去保存即可.或者把下面的附件上传到里面解压.可到一个qq.php
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有