wordpress如何防止文章内容被复制,下面web建站小编给大家详细介绍一下实现代码!
找到header.php模板,在<?php wp_head(); ?>中新增以下代码:
<script>
// 禁止右键
document.oncontextmenu = function() {
return false
};
// 禁止图片拖放
document.ondragstart = function() {
return false
};
// 禁止选择文本
document.onselectstart = function() {
if (event.srcElement.type != "text" && event.srcElement.type != "textarea" && event.srcElement.type != "password") return false;
else return true;
};
if (window.sidebar) {
document.onmousedown = function(e) {
var obj = e.target;
if (obj.tagName.toUpperCase() == "INPUT" || obj.tagName.toUpperCase() == "TEXTAREA" || obj.tagName.toUpperCase() == "PASSWORD") return true;
else return false;
}
};
// 禁止frame标签引用
if (parent.frames.length > 0) top.location.replace(document.location);
</script>
上面是“wordpress如何防止文章复制(附代码)”的全面内容,想了解更多关于 wordpress 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_3331.html
workflows工作流
森林里一只空灵的犀鸟ComfyUI工作流
1个可爱的白色短发女孩
一个表情深思熟虑的成熟男人
一只蓬松柔软的圆形半鳄梨玩偶
stvmccrr风格的玫瑰花ComfyUI工作流
一个时间旅行女人的神秘剪影ComfyUI工作流
一只乌鸦栖息在一盏神灯上
一只精致透明的朱红色水晶狐狸
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

2023年程序猿如何给自己开启一场烟花盛会
css3实现星球旋转
js实现table表格动态新增行和列表
利用js+css3做一个小鱼游泳特效
3D彩色卡片
jquery做一个漂亮挂墙动态时钟
用ascii字符画图像










