纯代码免插件开启微信公众号回复验证码查看隐藏内容功能

WordPress插件  wechat-fans,  插件奈何不够人性化,只能设置一个验证码,所以就整合了一些大佬的文章,得出以下代码。

纯代码免插件开启微信公众号回复验证码查看隐藏内容功能-1

代码部署

在 functions.php 文件中加入以下代码      这个代码必须用 UTF-8-BOM 编码格式 修改中文,不然直接用主题编辑器修改会错位!!

CSS样式文件修改

将下面的代码添加到主题的 style.css 文件中去即可,如果放进 style.css 里边无效的话,可以放进:外观——自定义——额外css  里边

第一款:

CSS代码如下

/* 网站添加公众号涨粉功能样式代码 */
.post_hide_box, .secret-password{
	background: none repeat scroll 0 0 #fcffff;
	border: 1px dashed #24b4f0;
	color: #123456;
	padding: 10px;
	border-radius: 9px;
	margin: 18px 0px;
	overflow:hidden;
	clear:both;
	}
.post_hide_box .post-secret{
	font-size: 18px;
	line-height:20px; 
	color:#f0503c; 
	margin:5px;
	}
.post_hide_box form{ margin:15px 5px;}
.post_hide_box form span{ font-size:18px; font-weight:bold;}
.post_hide_box .erweima{ margin: 15px;}
.post_hide_box input[type=password]{
	color: #00a0f0;
	padding: 5px;
	background-color: #fff;
	border: 1px solid #24b4f0;
	border-radius: 5px;
	font-size: 12px;
	margin: 0px 5px;
	-moz-transition: border .25s linear,color .25s linear,background-color .25s linear; 
	-webkit-transition: border .25s linear,color .25s linear,background-color .25s linear; -o-transition: border .25s linear,color .25s linear,background-color .25s linear; 
	transition: border .25s linear,color .25s linear,background-color .25s linear;}
.post_hide_box input[type=submit] { 
    background: #24b4f0; 
	border: none; 
	padding: 5px;
	width: 88px;  
	color: #fff; 
	border-radius: 5px; 
	font-size: 16px;
	font-weight:bold;
	}
.details{
	color:#123456;
    font-size: 16px;
	line-height: 30px;
	margin: 5px;
	padding: 3px;
	}
.post_hide_box .details span{color:#e74c3c;}

第二款:

CSS代码如下

.post_hide_box, .secret-password {
	background: none repeat scroll 0 0 #efe;
	border-left: 5px solid #e74c3c;
	color: #555;
	padding: 10px 0 10px 10px;
	border-radius: 5px;
	margin-bottom: 15px;
	overflow: hidden;
	clear: both;
}
.post_hide_box .post-secret {
	font-size: 18px;
	line-height: 20px;
	color: #e74c3c;
	margin: 5px;
}
.post_hide_box form {
	margin: 15px 0;
}
.post_hide_box form span {
	font-size: 18px;
	font-weight: 700;
}
.post_hide_box .erweima {
	margin-left: 20px;
	margin-right: 16px;
}
.post_hide_box input[type=password] {
	color: #9ba1a8;
	padding: 6px;
	background-color: #f6f6f6;
	border: 1px solid #e4e6e8;
	font-size: 12px;
	-moz-transition: border .25s linear,color .25s linear,background-color .25s linear;
	-webkit-transition: border .25s linear,color .25s linear,background-color .25s linear;
	-o-transition: border .25s linear,color .25s linear,background-color .25s linear;
	transition: border .25s linear,color .25s linear,background-color .25s linear;
}
.post_hide_box input[type=submit] {
	background: #F88C00;
	border: none;
	border: 2px solid;
	border-color: #F88C00;
	border-left: none;
	border-top: none;
	padding: 0px;
	width: 100px;
	height: 38px;
	color: #fff;
	outline: 0;
	border-radius: 0 0 2px 0;
	font-size: 16px;
}
 
.post_hide_box .details span {
	color: #e74c3c;
}

之后再写文章时,文本——点击 公众号隐藏 按钮,将信息修改就行了


👋 感谢您的观看,对您有用就分享出去吧 !

如您有好的资源/素材,可参与创作者激励计划享投稿分成。分成介绍
投稿成功收录,即可获得 1-10元/篇奖励。(重复内容无奖励)
本站代码模板仅供学习交流使用请勿商业运营,严禁从事违法,侵权等任何非法活动,否则后果自负!
© 版权声明
THE END
文章不错?点个赞呗
点赞5赞赏 分享
评论 共3条

请登录后发表评论

随机看看好帖需要善于发现
热门圈子总有聊不完的话题