WordPress代码

/**
* WordPress文章部分内容关注微信公众号后可见
*/
function lxtx_secret_content($atts, $content=null){
extract(shortcode_atts(array('key'=>null,'keyword'=>null), $atts));
if(isset($_POST['secret_key']) && $_POST['secret_key']==$key){
return '<div class="secret-password">'.$content.'</div>';
} else {
return
'<div class="gzhhide">
<div ><img class="gzhcode" align="right" src="https://zpro.zptheme.com/wp-content/uploads/2019/12/1576936934-836f71af39cfdca.jpg"   alt="计划书之家"></div>
<div class="gzhtitle">抱歉!隐藏内容,请输入密码后可见!<i class="fa fa-lock"></i><span></span></div>
<div class="gzh-content">请打开微信扫描右边的二维码回复关键字“<span><b>'.$keyword.'</b></span>”获取密码,也可以微信直接搜索“计划书之家”关注微信公众号获取密码。</div>
 
<div class="gzhbox"><form action="'.get_permalink().'" method="post">
<input id="pwbox" type="password" size="20" name="secret_key" >
<button type="submit">立即提取</button></form></div></div>';
}
}
add_shortcode('gzh2v', 'lxtx_secret_content');
// 后台文本编辑框中添加公众号隐藏简码按钮
function lxtx_wpsites_add_gzh_quicktags() {
if (wp_script_is('quicktags')){
?>
<script type="text/javascript">
QTags.addButton( 'gzh2v', ' 公众号隐藏', '\n[gzh2v keyword="关键字" key="验证码"]隐藏内容[/gzh2v]', "" );
</script>
<?php
}
}
add_action( 'admin_print_footer_scripts', 'lxtx_wpsites_add_gzh_quicktags' );
 
// 文章页添加展开收缩效果
function xcollapse($atts, $content = null){
extract(shortcode_atts(array("title"=>""),$atts));
return '
 
<div style="margin: 0.5em 0;">
<div class="xControl">
<a href="javascript:void(0)" class="collapseButton xButton"> <i class="fa fa-toggle-on" aria-hidden="true">&nbsp;</i><span class="xTitle">'.$title.'</span></a>
<div style="clear: both;"></div>
</div>
<div class="xContent" style="display: none;">'.$content.'</div>
</div>';
}
add_shortcode('collapse', 'xcollapse');
 
//添加展开/收缩快捷标签按钮
function appthemes_add_collapse() {
?>
<script type="text/javascript">
if ( typeof QTags != 'undefined' ) {
QTags.addButton( 'collapse', '展开/收缩按钮', '[collapse title="点击展开 查看更多"]','[/collapse]' );
}
</script>
<?php
}
add_action('admin_print_footer_scripts', 'appthemes_add_collapse' );
/*文章页添加展开收缩效果*/
.xControl {
font-size: 15px;
font-weight: bold;
padding: 5px 0;
text-align: center;
margin: 18px 0px 18px -20px;
 
}
.xControl a{
text-decoration: none;
display: block;
}
 
&nbsp;
 
/*公众号隐藏*/
.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;
}
.post_hide_box .details span {
color:#e74c3c;
}
.gzhhide .gzhcode {
position:absolute;
width:100px;
height:100px;
right:20px;
top:50%;
margin-top:-50px
}
.gzhhide {
background:#fff;
border-radius:10px;
padding:20px;
margin:15px 0;
position:relative;
box-shadow:0 0 20px #d0d0d0
}
.gzhhide .gzhtitle {
position:relative;
font-size:17px;
font-weight:700;
color:#6c80a7;
padding:6px 140px 0 40px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
}
.gzhhide .gzhtitle .fa {
position:absolute;
left:0;
font-size:35px;
top:0
}
.gzh-content {
padding:20px 140px 15px 0;
font-size:14px;
color:#777
}
.gzhbox {
padding:0 140px 10px 0
}
.gzhbox input {
width:45%;
border:none;
color:#737373;
font-size:13px;
height:35px;
line-height:35px;
background:#f2f2f2;
border-radius:4px;
outline:none;
float:left;
padding:0 10px
}
.gzhbox button {
width:20%;
margin-left:15%;
border:none;
background-image: linear-gradient(to left, #f58365, #ff5c00);
color:#fff;
font-size:14px;
border-radius:5px
}
.gzhhide .gzhcode {
position:absolute;
width:100px;
height:100px;
right:20px;
top:50%;
margin-top:-50px
}
.gzhbox {
padding:0
}
.gzh-content {
padding:20px 90px 15px 0
}
.gzhhide .gzhcode {
width:120px;
height:120px
}
#vivideo {
height:200px
}

 

版权声明:原创作品,未经允许不得转载,否则将追究法律责任。
本站资源有的自互联网收集整理,如果侵犯了您的合法权益,请联系本站我们会及时删除。
本站资源仅供研究、学习交流之用,若使用商业用途,请购买正版授权,否则产生的一切后果将由下载用户自行承担。
本文链接:子佩工作室https://zptheme.com/2240.html
许可协议:《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权

本站分为普通会员,SVIP会员,永久会员。
SVIP会员新用户注册即送180天,到期后可邀请好友2位/180天进行无限续期。
永久会员支持微信支付在线开通。

积分是本站通用虚拟货币,可用于文章资源购买。
每天签到,评论或点赞文章,或者投稿都可免费获得积分
新用户注册免费赠送2积分 邀请用户注册2位/2积分

如果您已经成功付款但是网站没有弹出成功提示,请联系售后提供付款信息为您处理

本站资源属于虚拟商品,具有可复制性,可传播性,一旦授予,不接受任何形式的退款、换货要求。请您在购买获取之前确认好 是您所需要的资源

需要效果图的,可以联系售后(右侧核保售后,扫码添加或者点击 加入我们-联系客服)。或者微信添加企业微信:子佩工作室

计划书请提供费率条款(现价分红),100起。WP主题一般单个问题30起。主题二开500起,开发新主题3000起。低于1000须全款,其余先支付全款的60%,完成后支付余下的。

资源是指寿险计划书(定制除外),WP主题或插件不包含在永久会员之内!

发表回复